:inoremap <C-w> <C-g>u<C-w>
<C-g>u define o ponto de desfazer para o ponto atual. E então <C-w> faz o trabalho de exclusão.
Eu sou um usuário pro do vim, no entanto, de alguma forma eu não pareço ter definitivamente descoberto o uso do undo baseado no tempo, ou talvez eu realmente não goste. Existe uma maneira de desfazer uma exclusão causada por Ctrl - w A W3I ficará muito grata pela ajuda.
Obrigado.
O título da dica refere-se a Ctrl + U que é similar, mas não é o mesmo que Ctrl + W . No entanto, o mesmo método pode ser usado para ambos.
Recupere-se do Ctrl acidental + U .
You can't undo these deletions. However, what you've typed is still in the
.register. You can confirm that (after pressing Esc to return to normal mode) with the command:regwhich will list all registers (or just:reg .to display the.register). You may be able to copy the missing text from the register display, for example, with the mouse.Unfortunately, simply pasting the
.register won't help because it will repeat the Ctrl-u or Ctrl-w and will delete the text again. However, you can use another register (registerain the following)::let @a = @. "aPThe above will paste all the text you last inserted, including what was accidentally deleted.