1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 02:20:03 +08:00

Add support Left/Right in iedit-insert mode

This commit is contained in:
wsdjeg 2018-01-11 22:45:08 +08:00
parent 41f58eba01
commit 7ecd85a8a0
2 changed files with 17 additions and 7 deletions

View File

@ -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 == "\<Left>"
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 == "\<Right>"
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

View File

@ -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 |
| `<Left>` | Move cursor to left |
| `<Right>` | Move cursor to right |
##### Examples