From 65efdb7f4c0cbc7ba9dec30f02b4d7f587d632fd Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 14 Jan 2018 23:48:44 +0800 Subject: [PATCH] Add option for restore q key --- README.md | 2 +- autoload/SpaceVim.vim | 3 +++ autoload/SpaceVim/default.vim | 3 --- autoload/SpaceVim/layers/ui.vim | 5 +++++ doc/SpaceVim.txt | 3 +++ docs/documentation.md | 4 ++++ 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6f5b0cc66..e979dbd91 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Please star the project on github - it is a great way to show your appreciation ![welcome-page](https://user-images.githubusercontent.com/13142418/33793078-3446cb6e-dc76-11e7-9998-376a355557a4.png) -See the [documentation](https://spacevim.org/documentation) or [the list of layers](http://spacevim.org/layers/) for more information. +See the [Quick start guide](https://spacevim.org/quick-start-guide), [documentation](https://spacevim.org/documentation) or [the list of layers](http://spacevim.org/layers/) for more information. Here is a throughput graph of the repository for the last few weeks: diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index d13547ce2..23fe230a6 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -382,6 +382,9 @@ let g:spacevim_plugin_groups = [] " fuzzy find the repo you want. let g:spacevim_github_username = '' "" +" Set the default key for smart close windows, default is `q`. +let g:spacevim_windows_smartclose = 'q' +"" " Disable plugins by name. " > " let g:spacevim_disabled_plugins = ['vim-foo', 'vim-bar'] diff --git a/autoload/SpaceVim/default.vim b/autoload/SpaceVim/default.vim index fbec484d7..4a8fe4264 100644 --- a/autoload/SpaceVim/default.vim +++ b/autoload/SpaceVim/default.vim @@ -294,9 +294,6 @@ function! SpaceVim#default#SetMappings() abort \ 'Copy buffer absolute path to X11 clipboard','call zvim#util#CopyToClipboard()') call SpaceVim#mapping#def('nnoremap ', '', ':wincmd w', 'Switch to next window or tab','wincmd w') call SpaceVim#mapping#def('nnoremap ', '', ':wincmd p', 'Switch to previous window or tab','wincmd p') - call SpaceVim#mapping#def('nnoremap ', 'q', ':call zvim#util#SmartClose()', - \ 'Smart close windows', - \ 'call zvim#util#SmartClose()') endfunction fu! s:tobur(num) abort diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index 1a50650e1..70d5937a9 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -30,6 +30,11 @@ function! SpaceVim#layers#ui#config() abort let g:signify_disable_by_default = 0 let g:signify_line_highlight = 0 noremap :silent TagbarToggle + if empty(g:spacevim_windows_smartclose) + call SpaceVim#mapping#def('nnoremap ', g:spacevim_windows_smartclose, ':call zvim#util#SmartClose()', + \ 'Smart close windows', + \ 'call zvim#util#SmartClose()') + endif " Ui toggles call SpaceVim#mapping#space#def('nnoremap', ['t', '8'], 'call call(' \ . string(s:_function('s:toggle_fill_column')) . ', [])', diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 27d36ac4e..341e84663 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -406,6 +406,9 @@ Plugin groups to be loaded. Set the github username, It will be used for getting your starred repos, and fuzzy find the repo you want. + *g:spacevim_windows_smartclose* +Set the default key for smart close windows, default is `q`. + *g:spacevim_disabled_plugins* Disable plugins by name. > diff --git a/docs/documentation.md b/docs/documentation.md index 3cfa905b5..4f637b4a2 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -376,6 +376,10 @@ the option is `g:spacevim_windows_leader`, defalut value is `s`. the option is `g:spacevim_enable_language_specific_leader`, defalut value is 1. +- The `q` key does recording, but in SpaceVim it is used for smart close window. + +the option is `g:spacevim_windows_smartclose`, defalut value is `q`. If you still prefer the origin function of `q`, you can use an empty string to disable this feature. + [Send a PR](http://spacevim.org/development/) to add the differences you found in this section. ## Awesome ui