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

Re: Automating Vi Commands

Expand Messages
  • Gumnos (Tim Chase)
    ... Sounds exactly like the definition of vim s macros. In normal mode, just press q followed by a letter (to name the register into which the macro is
    Message 1 of 1 , Aug 2 6:39 AM
    • 0 Attachment
      > I use Vi regularly and know that <SHIFT> <J> will append lines, putting a
      > number in fromt of the command will cause Vi to append that many lines to
      > the current line.
      > My quation is can this be automated,

      Sounds exactly like the definition of vim's macros. In normal mode, just
      press "q" followed by a letter (to name the register into which the macro is
      recorded), do your stuff, and press "q" again to end recording. At that
      point, you can do use the "@" followed by that letter to execute the
      recorded macro. The @ can be preceeded by a count as well, so

      qa
      <do stuff>
      q

      25@a

      will <do stuff> 26 times (the original, and 25 more).
      For more info, check out ":he recording".

      -tim
    Your message has been successfully submitted and would be delivered to recipients shortly.