From e33498f4f2a96f76dbc2671b7a5502e9f9088a35 Mon Sep 17 00:00:00 2001 From: Shidong Wang Date: Sat, 19 Jan 2019 13:09:51 +0800 Subject: [PATCH 1/2] Remove vim-multiple-cursors.vim --- autoload/SpaceVim/layers/edit.vim | 1 - config/plugins/vim-multiple-cursors.vim | 39 ------------------------- 2 files changed, 40 deletions(-) diff --git a/autoload/SpaceVim/layers/edit.vim b/autoload/SpaceVim/layers/edit.vim index 3b4ef7406..517090e1c 100644 --- a/autoload/SpaceVim/layers/edit.vim +++ b/autoload/SpaceVim/layers/edit.vim @@ -17,7 +17,6 @@ function! SpaceVim#layers#edit#plugins() abort \ ['tpope/vim-surround'], \ ['tpope/vim-repeat'], \ ['junegunn/vim-emoji'], - \ ['terryma/vim-multiple-cursors', { 'loadconf' : 1, 'merged' : 0}], \ ['terryma/vim-expand-region', { 'loadconf' : 1}], \ ['kana/vim-textobj-user'], \ ['kana/vim-textobj-indent'], diff --git a/config/plugins/vim-multiple-cursors.vim b/config/plugins/vim-multiple-cursors.vim index cde4b0905..e69de29bb 100644 --- a/config/plugins/vim-multiple-cursors.vim +++ b/config/plugins/vim-multiple-cursors.vim @@ -1,39 +0,0 @@ -if g:spacevim_autocomplete_method ==# 'ycm' - function! s:disable_autocomplete() abort - - endfunction - function! s:enable_autocomplete() abort - - endfunction -elseif g:spacevim_autocomplete_method ==# 'neocomplete' - function! s:disable_autocomplete() abort - NeoCompleteLock - endfunction - function! s:enable_autocomplete() abort - NeoCompleteUnlock - endfunction -elseif g:spacevim_autocomplete_method ==# 'neocomplcache' "{{{ - function! s:disable_autocomplete() abort - NeoComplCacheDisable - endfunction - function! s:enable_autocomplete() abort - NeoComplCacheEnable - endfunction -elseif g:spacevim_autocomplete_method ==# 'deoplete' - function! s:disable_autocomplete() abort - call deoplete#disable() - endfunction - function! s:enable_autocomplete() abort - call deoplete#enable() - endfunction -endif -" Called once right before you start selecting multiple cursors -function! Multiple_cursors_before() - call s:disable_autocomplete() -endfunction - -" Called once only when the multiple selection is canceled (default ) -function! Multiple_cursors_after() - call s:enable_autocomplete() -endfunction -" vim:set et sw=2 cc=80: From fd16cf63a5f66e06ed9b15080f3dba9e05b19675 Mon Sep 17 00:00:00 2001 From: Shidong Wang Date: Sat, 19 Jan 2019 13:59:59 +0800 Subject: [PATCH 2/2] Fix type --- autoload/SpaceVim/mapping/space.vim | 4 +++- autoload/SpaceVim/plugins/highlight.vim | 5 ++++- docs/cn/layers/edit.md | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/autoload/SpaceVim/mapping/space.vim b/autoload/SpaceVim/mapping/space.vim index 4d002a450..dff69e23c 100644 --- a/autoload/SpaceVim/mapping/space.vim +++ b/autoload/SpaceVim/mapping/space.vim @@ -326,8 +326,10 @@ function! SpaceVim#mapping#space#init() abort xnoremap SpaceVim-plugin-iedit :call SpaceVim#plugins#iedit#start(1) call SpaceVim#mapping#space#def('nmap', ['s', 'e'], 'SpaceVim-plugin-iedit', \ 'start iedit mode', 0, 1) - call SpaceVim#mapping#space#def('nnoremap', ['s', 'h'], 'call SpaceVim#plugins#highlight#start()', + call SpaceVim#mapping#space#def('nnoremap', ['s', 'H'], 'call SpaceVim#plugins#highlight#start(1)', \ 'highlight all symbols', 1) + call SpaceVim#mapping#space#def('nnoremap', ['s', 'h'], 'call SpaceVim#plugins#highlight#start(0)', + \ 'highlight current symbols', 1) " Getting help let g:_spacevim_mappings_space.h.d = {'name' : '+help-describe'} call SpaceVim#mapping#space#def('nnoremap', ['h', 'd', 'b'], diff --git a/autoload/SpaceVim/plugins/highlight.vim b/autoload/SpaceVim/plugins/highlight.vim index 74cfd825f..4eb8434f9 100644 --- a/autoload/SpaceVim/plugins/highlight.vim +++ b/autoload/SpaceVim/plugins/highlight.vim @@ -114,8 +114,11 @@ function! s:init() abort endfunction " }}} +" use SPC s H to highlight all symbol on default range. +" use SPC s h to highlight current symbol on default range. + " public API func: start Highlight mode {{{ -function! SpaceVim#plugins#highlight#start() abort +function! SpaceVim#plugins#highlight#start(current) abort let curpos = getcurpos() let save_reg_k = @k normal! viw"ky diff --git a/docs/cn/layers/edit.md b/docs/cn/layers/edit.md index 86c3a6fe5..ad93d272d 100644 --- a/docs/cn/layers/edit.md +++ b/docs/cn/layers/edit.md @@ -12,6 +12,7 @@ lang: cn - [功能特性](#功能特性) - [模块选项](#模块选项) - [快捷键](#快捷键) + - [多光标支持](#多光标支持) @@ -39,7 +40,7 @@ lang: cn | ------------------ | ---------------------- | | `SPC x a {分隔符}` | 基于分隔符进行文本对齐 | -**默认的分隔符:** +默认的分隔符: - `=`: 对齐 `===`, `==`, `!=`, `>=` 等 - `&`: 对齐 `&` @@ -55,3 +56,7 @@ lang: cn - `}`: 对齐 `}` - `)`: 对齐 `)` +### 多光标支持 + +在 Visual 模式下可使用 Ctrl+n 按键选择下一个匹配位置。此时文档中所有匹配项都会被高亮,选中的匹配位置会有特殊高亮。 +可使用 Ctrl+x 按键跳过当前位置。