diff --git a/autoload/SpaceVim/layers/edit.vim b/autoload/SpaceVim/layers/edit.vim index 7b8274c9e..b55c7b87b 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/autoload/SpaceVim/mapping/space.vim b/autoload/SpaceVim/mapping/space.vim index be4f96476..aaa23d877 100644 --- a/autoload/SpaceVim/mapping/space.vim +++ b/autoload/SpaceVim/mapping/space.vim @@ -503,8 +503,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 2f0870144..5dc06b807 100644 --- a/autoload/SpaceVim/plugins/highlight.vim +++ b/autoload/SpaceVim/plugins/highlight.vim @@ -110,8 +110,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/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: diff --git a/docs/cn/layers/edit.md b/docs/cn/layers/edit.md index be5ea0168..1078e2d12 100644 --- a/docs/cn/layers/edit.md +++ b/docs/cn/layers/edit.md @@ -12,6 +12,7 @@ lang: cn - [功能特性](#功能特性) - [模块选项](#模块选项) - [快捷键](#快捷键) + - [多光标支持](#多光标支持) @@ -40,7 +41,7 @@ lang: cn | ------------------ | ---------------------- | | `SPC x a {分隔符}` | 基于分隔符进行文本对齐 | -**默认的分隔符:** +默认的分隔符: - `=`: 对齐 `===`, `==`, `!=`, `>=` 等 - `&`: 对齐 `&` @@ -60,6 +61,11 @@ lang: cn - `o`: 对齐 `+ - * / % ^` 等 - `r`: 对齐用户输入的正则表达式 +### 多光标支持 + +在 Visual 模式下可使用 Ctrl+n 按键选择下一个匹配位置。此时文档中所有匹配项都会被高亮,选中的匹配位置会有特殊高亮。 +可使用 Ctrl+x 按键跳过当前位置。 + | 快捷键 | 功能描述 | | ----------- | ------------------------------------ | | `SPC x j c` | 居中对齐当前段落 | @@ -70,3 +76,4 @@ lang: cn | `SPC x u` | 将选中字符串转为小写 | | `SPC x U` | 将选中字符串转为大写 | | `SPC x w c` | 统计选中区域的单词数 | +