File doc/emacscommandline.txt changed (mode: 100644) (index aac0204..5a67796) |
... |
... |
DELETION *emacscommandline-deletion* |
32 |
32 |
(i.e. the same behaviour as in Bash: unix-line-discard) |
(i.e. the same behaviour as in Bash: unix-line-discard) |
33 |
33 |
*META-D* delete word under cursor |
*META-D* delete word under cursor |
34 |
34 |
*META-Backspace* delete word backwards |
*META-Backspace* delete word backwards |
35 |
|
*CTRL-W* delete backwards to previous white-space character |
|
36 |
|
(i.e. the same behaviour as in Bash: unix-word-rubout) |
|
37 |
35 |
|
|
38 |
36 |
HISTORY *emacscommandline-history* |
HISTORY *emacscommandline-history* |
39 |
37 |
|
|
File plugin/emacscommandline.vim changed (mode: 100644) (index e9abd79..f0b5b1f) |
... |
... |
function! <SID>KillWord() |
142 |
142 |
return l:ret |
return l:ret |
143 |
143 |
endfunction |
endfunction |
144 |
144 |
|
|
145 |
|
cnoremap <C-W> <C-\>e<SID>DeleteBackwardsToWhiteSpace()<CR> |
|
146 |
|
function! <SID>DeleteBackwardsToWhiteSpace() |
|
147 |
|
call <SID>saveUndoHistory(getcmdline(), getcmdpos()) |
|
148 |
|
let l:loc = strpart(getcmdline(), 0, getcmdpos() - 1) |
|
149 |
|
let l:roc = strpart(getcmdline(), getcmdpos() - 1) |
|
150 |
|
if (l:loc =~ '\v\S\s*$') |
|
151 |
|
let l:rem = matchstr(l:loc, '\v\S+\s*$') |
|
152 |
|
elseif (l:loc =~ '\v^\s+$') |
|
153 |
|
let @c = l:loc |
|
154 |
|
call setcmdpos(1) |
|
155 |
|
return l:roc |
|
156 |
|
else |
|
157 |
|
return getcmdline() |
|
158 |
|
endif |
|
159 |
|
let @c = l:rem |
|
160 |
|
let l:pos = getcmdpos() - strlen(l:rem) |
|
161 |
|
let l:ret = strpart(l:loc, 0, strlen(l:loc) - strlen(l:rem)) . l:roc |
|
162 |
|
call <SID>saveUndoHistory(l:ret, l:pos) |
|
163 |
|
call setcmdpos(l:pos) |
|
164 |
|
return l:ret |
|
165 |
|
endfunction |
|
166 |
|
|
|
167 |
145 |
cnoremap <Esc><BS> <C-\>e<SID>BackwardKillWord()<CR> |
cnoremap <Esc><BS> <C-\>e<SID>BackwardKillWord()<CR> |
168 |
146 |
cmap <M-BS> <Esc><BS> |
cmap <M-BS> <Esc><BS> |
169 |
147 |
function! <SID>BackwardKillWord() |
function! <SID>BackwardKillWord() |