diff --git a/autoload/SpaceVim/plugins/iedit.vim b/autoload/SpaceVim/plugins/iedit.vim index f2b217798..2d9e2b744 100644 --- a/autoload/SpaceVim/plugins/iedit.vim +++ b/autoload/SpaceVim/plugins/iedit.vim @@ -23,6 +23,7 @@ " Iedit-Normal a start iedit-insert mode after cursor " Iedit-Normal e forward to the end of word " Iedit-Normal w forward to the begin of next word +" Iedit-Normal b move to the begin of current word " < let s:stack = [] @@ -341,6 +342,18 @@ function! s:handle_normal(char) abort let s:cursor_stack[i].begin = substitute(s:cursor_stack[i].begin, '.$', '', 'g') let s:cursor_stack[i].end = substitute(s:cursor_stack[i].end, '^\s*\S*', '', 'g') endfor + elseif a:char ==# 'b' + " b: move to the begin of current word + for i in range(len(s:cursor_stack)) + let word = matchstr(s:cursor_stack[i].begin, '\S*\s*$') + let s:cursor_stack[i].end = + \ word + \ . s:cursor_stack[i].cursor + \ . s:cursor_stack[i].end + let s:cursor_stack[i].begin = substitute(s:cursor_stack[i].begin, '\S*\s*$', '', 'g') + 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 elseif a:char ==# 'w' for i in range(len(s:cursor_stack)) let word = matchstr(s:cursor_stack[i].end, '^\S*\s*') diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index ff929ba91..fe4e2bfa8 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -5432,6 +5432,7 @@ After starting iedit, the following key bindings can be used: Iedit-Normal a start iedit-insert mode after cursor Iedit-Normal e forward to the end of word Iedit-Normal w forward to the begin of next word + Iedit-Normal b move to the begin of current word < ==============================================================================