mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 02:50:03 +08:00
Add: add a new key binding 's' for iedit-model. (#2723)
This commit is contained in:
parent
fa2fb7ab55
commit
b905448fbc
@ -197,6 +197,16 @@ function! s:handle_normal(char) abort
|
||||
let s:cursor_stack[i].end = ''
|
||||
endfor
|
||||
redrawstatus!
|
||||
elseif a:char == 115 " s
|
||||
let s:mode = 'i'
|
||||
let w:spacevim_iedit_mode = s:mode
|
||||
let w:spacevim_statusline_mode = 'ii'
|
||||
for i in range(len(s:cursor_stack))
|
||||
let s:cursor_stack[i].begin = s:cursor_stack[i].begin
|
||||
let s:cursor_stack[i].cursor = matchstr(s:cursor_stack[i].end, '^.')
|
||||
let s:cursor_stack[i].end = substitute(s:cursor_stack[i].end, '^.', '', 'g')
|
||||
endfor
|
||||
redrawstatus!
|
||||
elseif a:char ==# "\<Left>" || a:char == 104
|
||||
for i in range(len(s:cursor_stack))
|
||||
if !empty(s:cursor_stack[i].begin)
|
||||
|
@ -1687,6 +1687,7 @@ SpaceVim uses a powerful iedit mode to quick edit multiple occurrences of a symb
|
||||
| `0` / `<Home>` | 跳至当前 occurrence 的开头 |
|
||||
| `$` / `<End>` | 跳至当前 occurrence 的结尾 |
|
||||
| `D` | 删除所有 occurrences |
|
||||
| `s` | 删除所有 occurrences 中光标下的字符 并进入 `iedit-Insert` 模式 |
|
||||
| `S` | 删除所有 occurrences 并进入 `iedit-Insert` 模式 |
|
||||
| `gg` | 跳至第一个 occurrence |
|
||||
| `G` | 跳至最后一个 occurrence |
|
||||
|
@ -1702,6 +1702,7 @@ The default color for iedit is `red`/`green` which is based on the current color
|
||||
| `0`/`<Home>` | go to the beginning of the current occurrence |
|
||||
| `$`/`<End>` | go to the end of the current occurrence |
|
||||
| `D` | delete the occurrences |
|
||||
| `s` | delete the character under cursor in all the occurrences and switch to iedit-Insert mode |
|
||||
| `S` | delete the occurrences and switch to iedit-Insert mode |
|
||||
| `gg` | go to first occurrence |
|
||||
| `G` | go to last occurrence |
|
||||
|
Loading…
Reference in New Issue
Block a user