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

Re: map problem in Vim 6.0

Expand Messages
  • Ofer Roter
    I think you can use macros (registers) and mapping. Try to change the mapping to: map C : 0i# j and then use macro (for Ex. c , but you can chose
    Message 1 of 7 , Feb 27, 2002
    • 0 Attachment
      I think you can use macros (registers) and mapping.

      Try to change the mapping to:
      map C :<c-u><CR>0i#<Esc>j

      and then use macro (for Ex. c , but you can chose any letter you want):
      qcCq

      Now you can type:
      10@c

      and i think you will get 10 lines commented.

      look at

      :help recording

      HTH,
      Ofer.



      Greg Roll wrote:

      > I'm trying to setup a mapping in my .vimrc file to allow be to block comment
      > / uncomment lines of code in a perl script. I'm using the following
      > commands:map C 0i#<Esc>jmap T 0xjThese work fine when I issue them one by one,
      > but if I try to repeat the command... by typing '10C' instead of repeating
      > the command an commenting the next 10 lines... it appends this number to the
      > start and I end up with 100 # marks on my line.... How can I make vim
      > recognize to repeat the entire mapping?Greg Roll
    Your message has been successfully submitted and would be delivered to recipients shortly.