From a521307853f1dc02d9a55e4f22408d4f7c17616a Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 18 Dec 2017 23:48:14 +0800 Subject: [PATCH 01/11] Update java layer --- autoload/SpaceVim/layers/lang/java.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/autoload/SpaceVim/layers/lang/java.vim b/autoload/SpaceVim/layers/lang/java.vim index 95e4338dd..9ea4677c4 100644 --- a/autoload/SpaceVim/layers/lang/java.vim +++ b/autoload/SpaceVim/layers/lang/java.vim @@ -60,6 +60,7 @@ endfunction function! SpaceVim#layers#lang#java#config() abort call SpaceVim#mapping#space#regesit_lang_mappings('java', funcref('s:language_specified_mappings')) + call SpaceVim#plugins#repl#reg('java', 'jshell') augroup SpaceVim_lang_java au! autocmd FileType java setlocal omnifunc=javacomplete#Complete @@ -152,6 +153,19 @@ function! s:language_specified_mappings() abort call SpaceVim#mapping#space#langSPC('nnoremap', ['l','m', 't'], 'call call(' \ . string(function('s:execCMD')) . ', ["mvn test"])', \ 'Run maven test', 1) + let g:_spacevim_mappings_space.l.s = {'name' : '+Send'} + call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'i'], + \ 'call SpaceVim#plugins#repl#start("java")', + \ 'start REPL process', 1) + call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'l'], + \ 'call SpaceVim#plugins#repl#send("line")', + \ 'send line and keep code buffer focused', 1) + call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'b'], + \ 'call SpaceVim#plugins#repl#send("buffer")', + \ 'send buffer and keep code buffer focused', 1) + call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 's'], + \ 'call SpaceVim#plugins#repl#send("selection")', + \ 'send selection and keep code buffer focused', 1) endfunction function! s:java_mappings() abort From 36178d7c98ab1fbcaeb36e048dc5b84b8c41680c Mon Sep 17 00:00:00 2001 From: Arith Xu Date: Tue, 19 Dec 2017 09:31:58 +0800 Subject: [PATCH 02/11] 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 e9ab27d943a548dd60da6cf7050588a1f1ab7748 Mon Sep 17 00:00:00 2001 From: Arith Xu Date: Tue, 19 Dec 2017 09:31:58 +0800 Subject: [PATCH 03/11] 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 04/11] 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 05/11] 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 06/11] 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 From e82ead0554e377385be5a1b67e7132696ae89492 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 19 Dec 2017 19:07:12 +0800 Subject: [PATCH 07/11] Fix job call back func --- autoload/SpaceVim/plugins/repl.vim | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/autoload/SpaceVim/plugins/repl.vim b/autoload/SpaceVim/plugins/repl.vim index 748891ee6..2a4a3639d 100644 --- a/autoload/SpaceVim/plugins/repl.vim +++ b/autoload/SpaceVim/plugins/repl.vim @@ -87,14 +87,12 @@ if has('nvim') && exists('*chanclose') if s:_out_data[-1] == '' call remove(s:_out_data, -1) let lines = s:_out_data - else - let lines = s:_out_data + if !empty(lines) + call s:BUFFER.buf_set_lines(s:bufnr, s:lines , s:lines + 1, 0, lines) + endif + let s:_out_data = [''] + let s:lines += len(lines) endif - if !empty(lines) - call s:BUFFER.buf_set_lines(s:bufnr, s:lines , s:lines + 1, 0, lines) - endif - let s:lines += len(lines) - let s:_out_data = [''] call s:update_statusline() endfunction From 4c53a526116ba149c980f94ccb593f3b0ecd0959 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 19 Dec 2017 20:22:19 +0800 Subject: [PATCH 08/11] Fix java doc --- docs/layers/lang/java.md | 69 +++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/docs/layers/lang/java.md b/docs/layers/lang/java.md index 98098e25a..daa93e056 100644 --- a/docs/layers/lang/java.md +++ b/docs/layers/lang/java.md @@ -1,6 +1,6 @@ --- title: "SpaceVim lang#java layer" -description: "This layer is for Java development" +description: "This layer is for Java development. All the features such as code completion, formatting, syntax checking, REPL and debug have be done in this layer." --- # [SpaceVim Layers:](https://spacevim.org/layers) lang#java @@ -8,13 +8,15 @@ description: "This layer is for Java development" - [Description](#description) -- [Layer Installation](#layer-installation) +- [Feature](#feature) +- [Install](#install) - [Key bindings](#key-bindings) - - [Java language specified key bindings](#java-language-specified-key-bindings) - - [Maven](#maven) - - [Jump](#jump) - - [Problems buffer](#problems-buffer) - - [Project buffer](#project-buffer) + - [Import key bindings](#import-key-bindings) + - [Generate key bindings](#generate-key-bindings) + - [Code formatting](#code-formatting) + - [Maven](#maven) + - [Jump](#jump) + - [Inferior REPL process](#inferior-repl-process) @@ -22,15 +24,22 @@ description: "This layer is for Java development" This layer is for Java development. -## Layer Installation +## Feature + +- code completion: `autocomplete` layer +- code formatting +- refactoring +- syntax checking: `checkers` layer +- REPL(need java8's jshell) +- debug: check out the `debug` layer + +## Install To use this configuration layer, add `SPLayer 'lang#java'` to your custom configuration file. ## Key bindings -### Java language specified key bindings - -**Import key bindings:** +### Import key bindings | Key Binding | Description | | -------------------- | ------------------------------- | @@ -42,24 +51,24 @@ To use this configuration layer, add `SPLayer 'lang#java'` to your custom config | `R` (Insert) | Remove unused classes | | `i` (Insert) | smart import class under cursor | -**Generate key bindings:** +### Generate key bindings | Mode | Key Binding | Description | | ------------- | ----------- | ------------------------------------- | -| normal | `SPC l A` | generate accessors | -| normal/visual | `SPC l s` | generate setter accessor | -| normal/visual | `SPC l g` | generate getter accessor | -| normal/visual | `SPC l a` | generate setter and getter accessor | -| normal | `SPC l M` | generate abstract methods | +| normal | `SPC l g A` | generate accessors | +| normal/visual | `SPC l g s` | generate setter accessor | +| normal/visual | `SPC l g g` | generate getter accessor | +| normal/visual | `SPC l g a` | generate setter and getter accessor | +| normal | `SPC l g M` | generate abstract methods | | insert | `s` | generate setter accessor | | insert | `g` | generate getter accessor | | insert | `a` | generate getter and setter accessor | -| normal | `SPC l ts` | generate toString function | -| normal | `SPC l eq` | generate equals and hashcode function | -| normal | `SPC l c` | generate constructor | -| normal | `SPC l C` | generate default constructor | +| normal | `SPC l g t` | generate toString function | +| normal | `SPC l g e` | generate equals and hashcode function | +| normal | `SPC l g c` | generate constructor | +| normal | `SPC l g C` | generate default constructor | -**Code formatting:** +### 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. @@ -68,7 +77,7 @@ 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. -#### Maven +### Maven | Key Binding | Description | | ----------- | ------------------------------ | @@ -79,12 +88,20 @@ to SpaceVim custom configuration file. | `SPC l m R` | Run one maven goal | | `SPC l m t` | Run maven test | -#### Jump +### Jump | Key Binding | Description | | ----------- | ---------------------- | | `SPC l j a` | jump to alternate file | -### Problems buffer +### Inferior REPL process -### Project buffer +Start a `jshell` inferior REPL process with `SPC l s i`. + +Send code to inferior process commands: + +| Key Binding | Description | +| ----------- | ------------------------------------------------ | +| `SPC l s b` | send buffer and keep code buffer focused | +| `SPC l s l` | send line and keep code buffer focused | +| `SPC l s s` | send selection text and keep code buffer focused | From 6a7c13dc2b857fc9c057df0a5e309cfafe830924 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 19 Dec 2017 20:31:44 +0800 Subject: [PATCH 09/11] Update java key bindings --- autoload/SpaceVim/layers/lang/java.vim | 19 +++++++------ doc/SpaceVim.txt | 39 ++++++++++++++++++-------- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/autoload/SpaceVim/layers/lang/java.vim b/autoload/SpaceVim/layers/lang/java.vim index 9ea4677c4..f59abad28 100644 --- a/autoload/SpaceVim/layers/lang/java.vim +++ b/autoload/SpaceVim/layers/lang/java.vim @@ -96,31 +96,32 @@ function! s:language_specified_mappings() abort \ 'Smart import class under cursor', 0) " Generate key bindings - call SpaceVim#mapping#space#langSPC('nmap', ['l','A'], + let g:_spacevim_mappings_space.l.g = {'name' : '+Generate'} + call SpaceVim#mapping#space#langSPC('nmap', ['l', 'g', 'A'], \ '(JavaComplete-Generate-Accessors)', \ 'generate setter accessor', 0) - call SpaceVim#mapping#space#langSPC('nmap', ['l','s'], + call SpaceVim#mapping#space#langSPC('nmap', ['l', 'g', 's'], \ '(JavaComplete-Generate-AccessorSetter)', \ 'generate setter accessor', 0) - call SpaceVim#mapping#space#langSPC('nmap', ['l','g'], + call SpaceVim#mapping#space#langSPC('nmap', ['l', 'g', 'g'], \ '(JavaComplete-Generate-AccessorGetter)', \ 'generate getter accessor', 0) - call SpaceVim#mapping#space#langSPC('nmap', ['l','a'], + call SpaceVim#mapping#space#langSPC('nmap', ['l', 'g', 'a'], \ '(JavaComplete-Generate-AccessorSetterGetter)', \ 'generate setter and getter accessor', 0) - call SpaceVim#mapping#space#langSPC('nmap', ['l','M'], + call SpaceVim#mapping#space#langSPC('nmap', ['l', 'g', 'M'], \ '(JavaComplete-Generate-AbstractMethods)', \ 'Generate abstract methods', 0) - call SpaceVim#mapping#space#langSPC('nmap', ['l','c'], + call SpaceVim#mapping#space#langSPC('nmap', ['l', 'g', 'c'], \ '(JavaComplete-Generate-Constructor)', \ 'Generate constructor', 0) - call SpaceVim#mapping#space#langSPC('nmap', ['l','C'], + call SpaceVim#mapping#space#langSPC('nmap', ['l', 'g', 'C'], \ '(JavaComplete-Generate-DefaultConstructor)', \ 'Generate default constructor', 0) - call SpaceVim#mapping#space#langSPC('nmap', ['l','eq'], + call SpaceVim#mapping#space#langSPC('nmap', ['l', 'g', 'e'], \ '(JavaComplete-Generate-EqualsAndHashCode)', \ 'Generate equals functions', 0) - call SpaceVim#mapping#space#langSPC('nmap', ['l','ts'], + call SpaceVim#mapping#space#langSPC('nmap', ['l', 'g', 't'], \ '(JavaComplete-Generate-ToString)', \ 'Generate toString function', 0) diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index fa4fd0083..ba0081245 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -37,18 +37,19 @@ CONTENTS *SpaceVim-contents* 14. lang#java.................................|SpaceVim-layer-lang-java| 15. lang#julia...............................|SpaceVim-layer-lang-julia| 16. lang#kotlin.............................|SpaceVim-layer-lang-kotlin| - 17. lang#ocaml...............................|SpaceVim-layer-lang-ocaml| - 18. lang#php...................................|SpaceVim-layer-lang-php| - 19. lang#pony.................................|SpaceVim-layer-lang-pony| - 20. lang#puppet.............................|SpaceVim-layer-lang-puppet| - 21. lang#python.............................|SpaceVim-layer-lang-python| - 22. lang#rust.................................|SpaceVim-layer-lang-rust| - 23. lang#scala...............................|SpaceVim-layer-lang-scala| - 24. lang#tmux.................................|SpaceVim-layer-lang-tmux| - 25. lang#xml...................................|SpaceVim-layer-lang-xml| - 26. operator...................................|SpaceVim-layer-operator| - 27. shell.........................................|SpaceVim-layer-shell| - 28. tmux...........................................|SpaceVim-layer-tmux| + 17. lang#lua...................................|SpaceVim-layer-lang-lua| + 18. lang#ocaml...............................|SpaceVim-layer-lang-ocaml| + 19. lang#php...................................|SpaceVim-layer-lang-php| + 20. lang#pony.................................|SpaceVim-layer-lang-pony| + 21. lang#puppet.............................|SpaceVim-layer-lang-puppet| + 22. lang#python.............................|SpaceVim-layer-lang-python| + 23. lang#rust.................................|SpaceVim-layer-lang-rust| + 24. lang#scala...............................|SpaceVim-layer-lang-scala| + 25. lang#tmux.................................|SpaceVim-layer-lang-tmux| + 26. lang#xml...................................|SpaceVim-layer-lang-xml| + 27. operator...................................|SpaceVim-layer-operator| + 28. shell.........................................|SpaceVim-layer-shell| + 29. tmux...........................................|SpaceVim-layer-tmux| 6. API........................................................|SpaceVim-api| 1. cmdlinemenu................................|SpaceVim-api-cmdlinemenu| 2. data#list....................................|SpaceVim-api-data-list| @@ -898,6 +899,20 @@ LANG#KOTLIN *SpaceVim-layer-lang-kotlin* This layer is for kotlin development. +============================================================================== +LANG#LUA *SpaceVim-layer-lang-lua* + +This layer includes utilities and language-specific mappings for lua +development. + +MAPPINGS + +> + Mode Key Function + --------------------------------------------- + normal SPC l r lua run +< + ============================================================================== LANG#OCAML *SpaceVim-layer-lang-ocaml* From 3b1870bd57f90f9996c052a1112d46948bf70017 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 19 Dec 2017 20:53:06 +0800 Subject: [PATCH 10/11] Update java layer doc --- autoload/SpaceVim/layers/lang/java.vim | 66 ++++++++++++++++++-------- doc/SpaceVim.txt | 66 ++++++++++++++++++-------- 2 files changed, 90 insertions(+), 42 deletions(-) diff --git a/autoload/SpaceVim/layers/lang/java.vim b/autoload/SpaceVim/layers/lang/java.vim index f59abad28..14835b407 100644 --- a/autoload/SpaceVim/layers/lang/java.vim +++ b/autoload/SpaceVim/layers/lang/java.vim @@ -5,39 +5,63 @@ " " @subsection Mappings " > -" Import mappings: +" Import key bindings: " " Mode Key Function " ------------------------------------------------------------- " normal import class under cursor " insert import class under cursor -" normal jI import missing classes -" normal jR remove unused imports -" normal ji smart import class under cursor -" normal jii same as +" normal SPC l I import missing classes +" normal SPC l R remove unused imports +" normal SPC l i smart import class under cursor " insert I import missing imports " insert R remove unused imports " insert i smart import class under cursor -" insert ii add import for class under cursor " -" Generate mappings: +" Generate key bindings: " " Mode Key Function " ------------------------------------------------------------- -" normal jA generate accessors -" normal js generate setter accessor -" normal jg generate getter accessor -" normal ja generate setter and getter accessor -" normal jts generate toString function -" normal jeq generate equals and hashcode function -" normal jc generate constructor -" normal jcc generate default constructor -" insert s generate setter accessor -" insert g generate getter accessor -" insert a generate getter and setter accessor -" visual js generate setter accessor -" visual jg generate getter accessor -" visual ja generate setter and getter accessor +" normal SPC l g A generate accessors +" normal SPC l g s generate setter accessor +" normal SPC l g g generate getter accessor +" normal SPC l g a generate setter and getter accessor +" normal SPC l g t generate toString function +" normal SPC l g e generate equals and hashcode function +" normal SPC l g c generate constructor +" normal SPC l g C generate default constructor +" insert s generate setter accessor +" insert g generate getter accessor +" insert a generate getter and setter accessor +" visual SPC l g s generate setter accessor +" visual SPC l g g generate getter accessor +" visual SPC l g a generate setter and getter accessor +" +" Maven key bindings: +" +" Mode Key Function +" ------------------------------------------------------------- +" normal SPC l m i Run maven clean install +" normal SPC l m I Run maven install +" normal SPC l m p Run one already goal from list +" normal SPC l m r Run maven goals +" normal SPC l m R Run one maven goal +" normal SPC l m t Run maven test +" +" Jump key bindings: +" +" Mode Key Function +" ------------------------------------------------------------- +" normal SPC l j a jump to alternate file +" +" REPL key bindings: +" +" Mode Key Function +" ------------------------------------------------------------- +" normal SPC l s i start a jshell inferior REPL process +" normal SPC l s b send buffer and keep code buffer focused +" normal SPC l s l send line and keep code buffer focused +" normal SPC l s s send selection text and keep code buffer focused " < " @subsection Code formatting " To make neoformat support java file, you should install uncrustify. diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index ba0081245..8a9a45f20 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -845,39 +845,63 @@ This layer is for Java development. MAPPINGS > - Import mappings: + Import key bindings: Mode Key Function ------------------------------------------------------------- normal import class under cursor insert import class under cursor - normal jI import missing classes - normal jR remove unused imports - normal ji smart import class under cursor - normal jii same as + normal SPC l I import missing classes + normal SPC l R remove unused imports + normal SPC l i smart import class under cursor insert I import missing imports insert R remove unused imports insert i smart import class under cursor - insert ii add import for class under cursor - Generate mappings: + Generate key bindings: Mode Key Function ------------------------------------------------------------- - normal jA generate accessors - normal js generate setter accessor - normal jg generate getter accessor - normal ja generate setter and getter accessor - normal jts generate toString function - normal jeq generate equals and hashcode function - normal jc generate constructor - normal jcc generate default constructor - insert s generate setter accessor - insert g generate getter accessor - insert a generate getter and setter accessor - visual js generate setter accessor - visual jg generate getter accessor - visual ja generate setter and getter accessor + normal SPC l g A generate accessors + normal SPC l g s generate setter accessor + normal SPC l g g generate getter accessor + normal SPC l g a generate setter and getter accessor + normal SPC l g t generate toString function + normal SPC l g e generate equals and hashcode function + normal SPC l g c generate constructor + normal SPC l g C generate default constructor + insert s generate setter accessor + insert g generate getter accessor + insert a generate getter and setter accessor + visual SPC l g s generate setter accessor + visual SPC l g g generate getter accessor + visual SPC l g a generate setter and getter accessor + + Maven key bindings: + + Mode Key Function + ------------------------------------------------------------- + normal SPC l m i Run maven clean install + normal SPC l m I Run maven install + normal SPC l m p Run one already goal from list + normal SPC l m r Run maven goals + normal SPC l m R Run one maven goal + normal SPC l m t Run maven test + + Jump key bindings: + + Mode Key Function + ------------------------------------------------------------- + normal SPC l j a jump to alternate file + + REPL key bindings: + + Mode Key Function + ------------------------------------------------------------- + normal SPC l s i start a jshell inferior REPL process + normal SPC l s b send buffer and keep code buffer focused + normal SPC l s l send line and keep code buffer focused + normal SPC l s s send selection text and keep code buffer focused < CODE FORMATTING To make neoformat support java file, you should install uncrustify. or From a9b7999f9d34f52b48b6c086aecae0c0e720113a Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 19 Dec 2017 21:32:07 +0800 Subject: [PATCH 11/11] Update blog --- .../2017-02-11-use-vim-as-a-java-ide.md | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/docs/_posts/2017-02-11-use-vim-as-a-java-ide.md b/docs/_posts/2017-02-11-use-vim-as-a-java-ide.md index f8d6ebd23..cf86078aa 100644 --- a/docs/_posts/2017-02-11-use-vim-as-a-java-ide.md +++ b/docs/_posts/2017-02-11-use-vim-as-a-java-ide.md @@ -9,12 +9,15 @@ redirect_from: "/2017/02/11/use-vim-as-a-java-ide.html" I am a vimmer and a java developer. Here are some useful plugins for developing java in vim/neovim. -![2017-02-01_1360x721](https://cloud.githubusercontent.com/assets/13142418/22506638/84705532-e8bc-11e6-8b72-edbdaf08426b.png) +![beautiful UI](https://user-images.githubusercontent.com/13142418/33804722-bc241f50-dd70-11e7-8dd8-b45827c0019c.png) ## Project manager + 1. [unite](https://github.com/Shougo/unite.vim) - file and code fuzzy founder. -![](https://s3.amazonaws.com/github-csexton/unite-01.gif) +The next version of unite is [denite](https://github.com/Shougo/denite.nvim), Denite is a dark powered plugin for Neovim/Vim to unite all interfaces. + +![unite](https://s3.amazonaws.com/github-csexton/unite-01.gif) The unite or unite.vim plug-in can search and display information from arbitrary sources like files, buffers, recently used files or registers. You can run several pre-defined actions on a target displayed in the unite window. @@ -22,7 +25,7 @@ The difference between unite and similar plug-ins like fuzzyfinder, ctrl-p or ku You can also use unite with [ag](https://github.com/ggreer/the_silver_searcher), that will make searching faster. -*config unite with ag or other tools support* +_config unite with ag or other tools support_ ```viml if executable('hw') @@ -75,7 +78,8 @@ endif 2. [vimfiler](https://github.com/Shougo/vimfiler.vim) - A powerful file explorer implemented in Vim script -*Use vimfiler as default file explorer* +_Use vimfiler as default file explorer_ + > for more information, you should read the documentation of vimfiler. ```viml @@ -111,17 +115,18 @@ BTW, the google's [java formatter](https://github.com/google/google-java-format) ## Code completion 1. [javacomplete2](https://github.com/artur-shaik/vim-javacomplete2) - Updated javacomplete plugin for vim - - Demo - ![vim-javacomplete2](https://github.com/artur-shaik/vim-javacomplete2/raw/master/doc/demo.gif) + - Demo - - Generics demo + ![vim-javacomplete2](https://github.com/artur-shaik/vim-javacomplete2/raw/master/doc/demo.gif) - ![vim-javacomplete2](https://github.com/artur-shaik/vim-javacomplete2/raw/master/doc/generics_demo.gif) + - Generics demo + + ![vim-javacomplete2](https://github.com/artur-shaik/vim-javacomplete2/raw/master/doc/generics_demo.gif) 2. [deoplete.nvim](https://github.com/Shougo/deoplete.nvim) - Dark powered asynchronous completion framework for neovim -3. [neocomplete.vim](https://github.com/Shougo/neocomplete.vim) - Next generation completion framework after neocomplcache +3. [neocomplete.vim](https://github.com/Shougo/neocomplete.vim) - Next generation completion framework after neocomplcache ## Syntax lint @@ -130,4 +135,8 @@ BTW, the google's [java formatter](https://github.com/google/google-java-format) I am maintainer of javac maker in neomake, the javac maker support maven project, gradle project or eclipse project. also you can set the classpath. +## REPL +you need to install jdk8 which provide a build-in tools `jshell`, and SpaceVim use the `jshell` as default inferior REPL process: + +![REPl-JAVA](https://user-images.githubusercontent.com/13142418/34159605-758461ba-e48f-11e7-873c-fc358ce59a42.gif)