Tuesday, August 28, 2012

Re: CTRL-W in insert mode

On Tue, Aug 28, 2012 at 10:07 AM, Christian Brabandt <cblists@256bit.org> wrote:
> On Tue, August 28, 2012 08:40, A Loumiotis wrote:
>> Thanks Jürgen for your help. I tried your suggestion but I couldn't
>> make it work. I'm relatively new user of VIM so I might be doing
>> something wrong. I solved my problem though by pressing:
>> <esc> u
>> after i press <c-w> in insert mode.
>
> The problem when exiting to normal mode and undoing is, that you undo
> the complete change (i.e. everything that was typed from when you
> started insert mode the last time, including the Ctrl-W or Ctrl-U).
> Therefore, you usually lose more than just the Ctrl-W part when you
> undo.
>
> A better approach is described in the Wiki:
>
> http://vim.wikia.com/wiki/Recover_from_accidental_Ctrl-U
>
> regards,
> Christian
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

Thanks Christian for the explanation and for the helpful link you
provided that made me understand that the map that Jürgen suggested
changes the behavior of undo in normal mode. That's why
<esc> u
was working the way that I wanted. I had already saved the map that
Jürgen suggested into my vimrc file.

Best,
Antonis

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment