From 68b89ec25c5bf62cd8c577113864857ba5d9f253 Mon Sep 17 00:00:00 2001 From: Arith Xu Date: Mon, 18 Dec 2017 17:50:30 +0800 Subject: [PATCH 1/9] add mapping descriptions --- autoload/SpaceVim/layers/lang/lua.vim | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 From 0a762d3117ac99442098a584a4132846b8fccf6c Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 18 Dec 2017 22:48:48 +0800 Subject: [PATCH 2/9] Clear cmdline after open file in flygrep --- autoload/SpaceVim/plugins/flygrep.vim | 1 + 1 file changed, 1 insertion(+) 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 From 991fc3bee5f9170751d81993e72eb24edc91ab43 Mon Sep 17 00:00:00 2001 From: techgaun Date: Mon, 18 Dec 2017 14:15:11 -0600 Subject: [PATCH 3/9] fix spelling error for stage all files --- autoload/SpaceVim/layers/git.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) From 36178d7c98ab1fbcaeb36e048dc5b84b8c41680c Mon Sep 17 00:00:00 2001 From: Arith Xu Date: Tue, 19 Dec 2017 09:31:58 +0800 Subject: [PATCH 4/9] add description to the DOC of golang layer --- docs/layers/lang/golang.md | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 docs/layers/lang/golang.md diff --git a/docs/layers/lang/golang.md b/docs/layers/lang/golang.md new file mode 100644 index 000000000..d6e7d6ea9 --- /dev/null +++ b/docs/layers/lang/golang.md @@ -0,0 +1,44 @@ +--- +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) golang + + + +- [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 + +| Key Binding | Description | +| ----------- | ---------------------------------------- | +| `SPC d l` | launching debugger | +| `SPC d c` | Continue the execution | +| `SPC d b` | Toggle a breakpoint for the current line | +| `SPC d B` | Clear all breakpoints | +| `SPC d o` | step over | +| `SPC d i` | step into functions | +| `SPC d O` | step out of current function | +| `SPC d e s` | Evaluate and print the selected text | +| `SPC d e e` | Evaluate the `` under the cursor | +| `SPC d e S` | Execute the selected text | +| `SPC d k` | Terminates the debugger | + +**Debug Transient State** + +key bindings is too long? use `SPC d .` to open the debug transient state: + +![Debug Transient State](https://user-images.githubusercontent.com/13142418/33996076-b03c05bc-e0a5-11e7-90fd-5f31e2703d7e.png) From 17ad2ea83d0aa901a50e0eb0cd06762cff9d7e62 Mon Sep 17 00:00:00 2001 From: Arith Xu Date: Mon, 18 Dec 2017 17:50:30 +0800 Subject: [PATCH 5/9] add mapping descriptions --- autoload/SpaceVim/layers/lang/lua.vim | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 From e9ab27d943a548dd60da6cf7050588a1f1ab7748 Mon Sep 17 00:00:00 2001 From: Arith Xu Date: Tue, 19 Dec 2017 09:31:58 +0800 Subject: [PATCH 6/9] add description to the DOC of golang layer --- docs/layers/lang/golang.md | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 docs/layers/lang/golang.md diff --git a/docs/layers/lang/golang.md b/docs/layers/lang/golang.md new file mode 100644 index 000000000..d6e7d6ea9 --- /dev/null +++ b/docs/layers/lang/golang.md @@ -0,0 +1,44 @@ +--- +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) golang + + + +- [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 + +| Key Binding | Description | +| ----------- | ---------------------------------------- | +| `SPC d l` | launching debugger | +| `SPC d c` | Continue the execution | +| `SPC d b` | Toggle a breakpoint for the current line | +| `SPC d B` | Clear all breakpoints | +| `SPC d o` | step over | +| `SPC d i` | step into functions | +| `SPC d O` | step out of current function | +| `SPC d e s` | Evaluate and print the selected text | +| `SPC d e e` | Evaluate the `` under the cursor | +| `SPC d e S` | Execute the selected text | +| `SPC d k` | Terminates the debugger | + +**Debug Transient State** + +key bindings is too long? use `SPC d .` to open the debug transient state: + +![Debug Transient State](https://user-images.githubusercontent.com/13142418/33996076-b03c05bc-e0a5-11e7-90fd-5f31e2703d7e.png) From 0cdc5f6f108793469832eae94aac078c1011a11d Mon Sep 17 00:00:00 2001 From: Arith Xu Date: Tue, 19 Dec 2017 16:23:46 +0800 Subject: [PATCH 7/9] add DOC for key mappings for golang layer --- docs/layers/lang/golang.md | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/docs/layers/lang/golang.md b/docs/layers/lang/golang.md index d6e7d6ea9..a475ca70c 100644 --- a/docs/layers/lang/golang.md +++ b/docs/layers/lang/golang.md @@ -23,22 +23,25 @@ To use this configuration layer, add `SPLayer 'lang#go` to your custom configura ## Key bindings +**Import key bindings:** + | Key Binding | Description | | ----------- | ---------------------------------------- | -| `SPC d l` | launching debugger | -| `SPC d c` | Continue the execution | -| `SPC d b` | Toggle a breakpoint for the current line | -| `SPC d B` | Clear all breakpoints | -| `SPC d o` | step over | -| `SPC d i` | step into functions | -| `SPC d O` | step out of current function | -| `SPC d e s` | Evaluate and print the selected text | -| `SPC d e e` | Evaluate the `` under the cursor | -| `SPC d e S` | Execute the selected text | -| `SPC d k` | Terminates the debugger | +| 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 | -**Debug Transient State** +**Code formatting:** -key bindings is too long? use `SPC d .` to open the debug transient state: +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. -![Debug Transient State](https://user-images.githubusercontent.com/13142418/33996076-b03c05bc-e0a5-11e7-90fd-5f31e2703d7e.png) +To make neoformat support java file, you should install uncrustify. or +download [google's formater jar](https://github.com/google/google-java-format) +and add `let g:spacevim_layer_lang_java_formatter = 'path/to/google-java-format.jar'` +to SpaceVim custom configuration file. From c67f98fd2e174999ad890c12fb7925a6aca778fd Mon Sep 17 00:00:00 2001 From: Arith Xu Date: Tue, 19 Dec 2017 16:42:29 +0800 Subject: [PATCH 8/9] add link for the DOC of golang layer --- docs/layers/index.md | 1 + docs/layers/lang/golang.md | 30 +++--------------------------- 2 files changed, 4 insertions(+), 27 deletions(-) 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/golang.md b/docs/layers/lang/golang.md index 680b16c56..ce2174979 100644 --- a/docs/layers/lang/golang.md +++ b/docs/layers/lang/golang.md @@ -23,7 +23,6 @@ To use this configuration layer, add `SPLayer 'lang#go` to your custom configura ## Key bindings -<<<<<<< HEAD **Import key bindings:** | Key Binding | Description | @@ -40,30 +39,7 @@ To use this configuration layer, add `SPLayer 'lang#go` to your custom configura **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. +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 java file, you should install uncrustify. or -download [google's formater jar](https://github.com/google/google-java-format) -and add `let g:spacevim_layer_lang_java_formatter = 'path/to/google-java-format.jar'` -to SpaceVim custom configuration file. -======= -| Key Binding | Description | -| ----------- | ---------------------------------------- | -| `SPC d l` | launching debugger | -| `SPC d c` | Continue the execution | -| `SPC d b` | Toggle a breakpoint for the current line | -| `SPC d B` | Clear all breakpoints | -| `SPC d o` | step over | -| `SPC d i` | step into functions | -| `SPC d O` | step out of current function | -| `SPC d e s` | Evaluate and print the selected text | -| `SPC d e e` | Evaluate the `` under the cursor | -| `SPC d e S` | Execute the selected text | -| `SPC d k` | Terminates the debugger | - -**Debug Transient State** - -key bindings is too long? use `SPC d .` to open the debug transient state: - -![Debug Transient State](https://user-images.githubusercontent.com/13142418/33996076-b03c05bc-e0a5-11e7-90fd-5f31e2703d7e.png) ->>>>>>> 36178d7c98ab1fbcaeb36e048dc5b84b8c41680c +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. From f5f36fef7e16351f6977d43a7c0d75f10c82e200 Mon Sep 17 00:00:00 2001 From: Arith Xu Date: Tue, 19 Dec 2017 16:45:55 +0800 Subject: [PATCH 9/9] rename golang.md to go.md to keep consistency --- docs/layers/lang/{golang.md => go.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename docs/layers/lang/{golang.md => go.md} (96%) diff --git a/docs/layers/lang/golang.md b/docs/layers/lang/go.md similarity index 96% rename from docs/layers/lang/golang.md rename to docs/layers/lang/go.md index ce2174979..70e2b931d 100644 --- a/docs/layers/lang/golang.md +++ b/docs/layers/lang/go.md @@ -3,7 +3,7 @@ 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) golang +# [SpaceVim Layers:](https://spacevim.org/layers) go