From 7ecd85a8a052cb46ff86e73eb71aa65fde8c1d1e Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Thu, 11 Jan 2018 22:45:08 +0800 Subject: [PATCH] Add support Left/Right in iedit-insert mode --- autoload/SpaceVim/plugins/iedit.vim | 8 ++++++++ docs/documentation.md | 16 +++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/autoload/SpaceVim/plugins/iedit.vim b/autoload/SpaceVim/plugins/iedit.vim index a19085580..c92b5a02f 100644 --- a/autoload/SpaceVim/plugins/iedit.vim +++ b/autoload/SpaceVim/plugins/iedit.vim @@ -127,6 +127,14 @@ function! s:handle_insert(char) abort elseif a:char == 11 let s:symbol_cursor = '' let s:symbol_end = '' + elseif a:char == "\" + let s:symbol_end = s:symbol_cursor . s:symbol_end + let s:symbol_cursor = matchstr(s:symbol_begin, '.$') + let s:symbol_begin = substitute(s:symbol_begin, '.$', '', 'g') + elseif a:char == "\" + let s:symbol_begin = s:symbol_begin . s:symbol_cursor + let s:symbol_cursor = matchstr(s:symbol_end, '^.') + let s:symbol_end = substitute(s:symbol_end, '^.', '', 'g') else let s:symbol_begin .= nr2char(a:char) endif diff --git a/docs/documentation.md b/docs/documentation.md index f099ca98d..2e93caa70 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -1299,13 +1299,13 @@ To Highlight the current symbol under point press `SPC s h`. Navigation between the highlighted symbols can be done with the commands: -| Key Binding | Description | -| ----------- | -------------------------------------------------------------------------------- | -| `*` | initiate navigation transient state on current symbol and jump forwards | -| `#` | initiate navigation transient state on current symbol and jump backwards | -| `SPC s e` | edit all occurrences of the current symbol | -| `SPC s h` | highlight the current symbol and all its occurrence within the current range | -| `SPC s H` | go to the last searched occurrence of the last highlighted symbol | +| Key Binding | Description | +| ----------- | ---------------------------------------------------------------------------- | +| `*` | initiate navigation transient state on current symbol and jump forwards | +| `#` | initiate navigation transient state on current symbol and jump backwards | +| `SPC s e` | edit all occurrences of the current symbol | +| `SPC s h` | highlight the current symbol and all its occurrence within the current range | +| `SPC s H` | go to the last searched occurrence of the last highlighted symbol | In highlight symbol transient state: @@ -1453,6 +1453,8 @@ The defalut color for iedit is `red`/`green` which is based on the current color | Key Binding | Description | | ----------- | ------------------------------ | | `Esc` | go back to `iedit-Normal` mode | +| `` | Move cursor to left | +| `` | Move cursor to right | ##### Examples