Loading ...
Sorry, an error occurred while loading the content.

Re: undoing iab expansion

Expand Messages
  • Tim Chase
    ... My first thought would be to use a mapping that invokes ... That way, when you type XX , an undo-point gets dropped, and you can then issue an u ndo from
    Message 1 of 3 , Jan 4, 2012
    • 0 Attachment
      On 01/04/12 06:06, sinbad wrote:
      > i use abbreviations to do autocomplete a big sentence.
      > sometimes the abr' will be inappropriate, so i want a quick
      > way to revert back to what i have originally typed. i know "u"
      > doesn't work. is there anyother way ?

      My first thought would be to use a mapping that invokes
      control-G_U before expanding to your text:

      :inoremap XX <c-g>uThis is what it expands to.

      That way, when you type "XX", an undo-point gets dropped, and you
      can then issue an "u"ndo from normal mode (whether hitting <esc>
      or a one-off via control+O)

      :help i_CTRL-G_u
      :h i_CTRL-O
      :h inoremap

      -tim


      --
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.