From bb2d69809b0f22f81bc0df14bae07ba534158146 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 26 Aug 2017 15:40:20 +0000 Subject: [PATCH 1/2] Update autocomplete layer --- docs/layers/autocomplete.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/layers/autocomplete.md b/docs/layers/autocomplete.md index 5d9eeb1e3..157edabcf 100644 --- a/docs/layers/autocomplete.md +++ b/docs/layers/autocomplete.md @@ -44,17 +44,18 @@ call SpaceVim#layers#load('autocomplete') You can customize the user experience of auto-completion with the following layer variables: -1. `auto-completion-return-key-behavior` set the action to perform when the `RET` key is pressed, the possible values are: +1. `auto-completion-return-key-behavior` set the action to perform when the `Return`/`Enter` key is pressed, the possible values are: - `complete` completes with the current selection -- `nil` does nothing +- `smart` completes with current selection and expand snippet or argvs +- `nil` 2. `auto-completion-tab-key-behavior` set the action to perform when the `TAB` key is pressed, the possible values are: - `smart` cycle candidates, expand snippets, jump parameters - `complete` completes with the current selection - `cycle` completes the common prefix and cycle between candidates -- `nil` does nothing +- `nil` insert a carriage return 3. `auto-completion-complete-with-key-sequence` is a string of two characters denoting a key sequence that will perform a `complete` action if the sequence as been entered quickly enough. If its value is `nil` then the feature is disabled. 4. `auto-completion-complete-with-key-sequence-delay` is the number of seconds to wait for the auto-completion key sequence to be entered. The default value is 0.1 seconds. @@ -98,13 +99,13 @@ call SpaceVim#layers#load('autocomplete', { ### auto-complete -| Key bindings | Description | -| ------------ | -------------------------------------------------------------------- | -| `` | select next candidate | -| `` | select previous candidate | -| `` | expand selection or select next candidate | -| `` | select previous candidate | -| `` | complete word, if word is already completed insert a carriage return | +| Key bindings | Description | +| ------------ | --------------------------------------------- | +| `` | select next candidate | +| `` | select previous candidate | +| `` | base on `auto-completion-tab-key-behavior` | +| `` | select previous candidate | +| `` | base on `auto-completion-return-key-behavior` | ### Neosnippet @@ -112,4 +113,3 @@ call SpaceVim#layers#load('autocomplete', { | ----------- | -------------------------------------------------------------- | | `M-/` | Expand a snippet if text before point is a prefix of a snippet | | `SPC i s` | List all current yasnippets for inserting | - From ce638b8a846e89daef19996c181e2012cae9d6e3 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 26 Aug 2017 15:45:41 +0000 Subject: [PATCH 2/2] Add gq for format Nmove text --- autoload/SpaceVim/mapping/g.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autoload/SpaceVim/mapping/g.vim b/autoload/SpaceVim/mapping/g.vim index ff2787f1f..25b0ba381 100644 --- a/autoload/SpaceVim/mapping/g.vim +++ b/autoload/SpaceVim/mapping/g.vim @@ -68,6 +68,8 @@ function! SpaceVim#mapping#g#init() abort nnoremap gn gn let g:_spacevim_mappings_g['Q'] = ['call feedkeys("gQ", "n")', 'switch to Ex mode'] nnoremap gQ gQ + let g:_spacevim_mappings_g['q'] = ['call feedkeys("gq", "n")', 'format Nmove text'] + nnoremap gq gq let g:_spacevim_mappings_g['R'] = ['call feedkeys("gR", "n")', 'enter VREPLACE mode'] nnoremap gR gR let g:_spacevim_mappings_g['T'] = ['call feedkeys("gT", "n")', 'previous tag page']