diff --git a/autoload/SpaceVim/layers/git.vim b/autoload/SpaceVim/layers/git.vim index 6a47d0b0e..9b059b42d 100644 --- a/autoload/SpaceVim/layers/git.vim +++ b/autoload/SpaceVim/layers/git.vim @@ -22,7 +22,7 @@ function! SpaceVim#layers#git#config() abort call SpaceVim#mapping#space#def('nnoremap', ['g', 'c'], 'Gina commit', 'edit git commit', 1) call SpaceVim#mapping#space#def('nnoremap', ['g', 'p'], 'Gina push', 'git push', 1) call SpaceVim#mapping#space#def('nnoremap', ['g', 'd'], 'Gina diff', 'view git diff', 1) - call SpaceVim#mapping#space#def('nnoremap', ['g', 'A'], 'Gina add .', 'state all files', 1) + call SpaceVim#mapping#space#def('nnoremap', ['g', 'A'], 'Gina add .', 'stage all files', 1) call SpaceVim#mapping#space#def('nnoremap', ['g', 'b'], 'Gina blame', 'view git blame', 1) else call SpaceVim#mapping#space#def('nnoremap', ['g', 's'], 'Gita status', 'git status', 1) @@ -31,7 +31,7 @@ function! SpaceVim#layers#git#config() abort call SpaceVim#mapping#space#def('nnoremap', ['g', 'c'], 'Gita commit', 'edit git commit', 1) call SpaceVim#mapping#space#def('nnoremap', ['g', 'p'], 'Gita push', 'git push', 1) call SpaceVim#mapping#space#def('nnoremap', ['g', 'd'], 'Gita diff', 'view git diff', 1) - call SpaceVim#mapping#space#def('nnoremap', ['g', 'A'], 'Gita add .', 'state all files', 1) + call SpaceVim#mapping#space#def('nnoremap', ['g', 'A'], 'Gita add .', 'stage all files', 1) call SpaceVim#mapping#space#def('nnoremap', ['g', 'b'], 'Gina blame', 'view git blame', 1) endif nmap hj (signify-next-hunk) diff --git a/autoload/SpaceVim/layers/lang/lua.vim b/autoload/SpaceVim/layers/lang/lua.vim index 6bebdb9f9..03a838897 100644 --- a/autoload/SpaceVim/layers/lang/lua.vim +++ b/autoload/SpaceVim/layers/lang/lua.vim @@ -1,3 +1,15 @@ +"" +" @section lang#lua, layer-lang-lua +" @parentsection layers +" This layer includes utilities and language-specific mappings for lua development. +" +" @subsection Mappings +" > +" Mode Key Function +" --------------------------------------------- +" normal SPC l r lua run +" < + function! SpaceVim#layers#lang#lua#plugins() abort let plugins = [] " Improved Lua 5.3 syntax and indentation support for Vim @@ -13,4 +25,14 @@ function! SpaceVim#layers#lang#lua#config() abort autocmd FileType lua setlocal omnifunc=luacomplete#complete augroup END endif + + call SpaceVim#mapping#space#regesit_lang_mappings('lua', funcref('s:language_specified_mappings')) +endfunction + +" Add language specific mappings +function! s:language_specified_mappings() abort + + call SpaceVim#mapping#space#langSPC('nmap', ['l','r'], + \ '(Lua)', + \ 'lua run', 0) endfunction diff --git a/autoload/SpaceVim/plugins/flygrep.vim b/autoload/SpaceVim/plugins/flygrep.vim index 68f88fbde..accb8af13 100644 --- a/autoload/SpaceVim/plugins/flygrep.vim +++ b/autoload/SpaceVim/plugins/flygrep.vim @@ -138,6 +138,7 @@ function! s:open_item() abort q exe 'e ' . filename exe linenr + redraw! endif endfunction diff --git a/docs/layers/index.md b/docs/layers/index.md index 375ef63c7..d7fdf5162 100644 --- a/docs/layers/index.md +++ b/docs/layers/index.md @@ -33,6 +33,7 @@ call SpaceVim#layers#load('shell', | [git](https://spacevim.org/layers/git/) | This layers adds extensive support for git | | [lang#c](https://spacevim.org/layers/lang/c/) | This layer is for c/c++/object-c development | | [lang#elixir](https://spacevim.org/layers/lang/elixir/) | This layer is for elixir development, provide autocompletion, syntax checking, code format for elixir file. | +| [lang#go](https://spacevim.org/layers/lang/go/) | This layer is for go development | | [lang#java](https://spacevim.org/layers/lang/java/) | This layer is for Java development | | [lang#javascript](https://spacevim.org/layers/lang/javascript/) | This layer is for JaveScript development | | [lang#lisp](https://spacevim.org/layers/lang/lisp/) | for lisp development | diff --git a/docs/layers/lang/go.md b/docs/layers/lang/go.md new file mode 100644 index 000000000..70e2b931d --- /dev/null +++ b/docs/layers/lang/go.md @@ -0,0 +1,45 @@ +--- +title: "SpaceVim golang layer" +description: "This layer is for golang development. It also provides additional language-specific key mappings." +--- + +# [SpaceVim Layers:](https://spacevim.org/layers) go + + + +- [Description](#description) +- [Install](#install) +- [Key bindings](#key-bindings) + + + +## Description + +This layer is for golang development. It also provides additional language-specific key mappings. + +## Install + +To use this configuration layer, add `SPLayer 'lang#go` to your custom configuration file. + +## Key bindings + +**Import key bindings:** + +| Key Binding | Description | +| ----------- | ---------------------------------------- | +| SPC l i | go implements | +| SPC l f | go info | +| SPC l e | go rename | +| SPC l r | go run | +| SPC l b | go build | +| SPC l t | go test | +| SPC l d | go doc | +| SPC l v | go doc vertical | +| SPC l c | go coverage | + +**Code formatting:** + +the default key bindings for format current buffer is `SPC b f`, and this key bindings is defined in [format layer](<>). you can also use `g=` to indent current buffer. + +To make neoformat support go files, you should have [go-fmt](http://golang.org/cmd/gofmt/) command available, or +install [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports). `go-fmt` is delivered by golang's default installation, so make sure you have correctly setup your go environment.