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

Re: How do I auto prepend text to each new line?

Expand Messages
  • Pavel Tavoda
    Linux gvim 6.4: set comments=:VIM_C : at the end of previous command is Now when I preppend line with VIM_C: on new line I will get same prefix with
    Message 1 of 5 , Feb 1, 2006
      Linux gvim 6.4:
      set comments=:VIM_C\:\
      at the end of previous command is \<space>

      Now when I preppend line with VIM_C: on new line I will get same
      prefix with space at after :. If you don't need 'comment' feature you
      can also do things like. Add comment:
      :%s/^/VIM_C: /
      Remove comments:
      :%s/^VIM_C: //

      Or you can use visual block (v) and when you press ':' you will get
      :'<,'>
      and you can continue till you get command like:
      :'<,'>s/^/VIM_C: /

      And if you are doing this really often you can define macro/mapping look for:
      :help macro

      Regards

      On 2/1/06, A. J. Mechelynck <antoine.mechelynck@...> wrote:
      > Walaschek, Bryan J (N-Anteon) wrote:
      > > Hey Tony -
      > >
      > > Thanks for the advice on using format-comments.
      > >
      > > I defined a format comment like this:
      > > set formatoptions=tcroq
      > > set comments=:VIM_NOTES
      > >
      > > But, I can't get my comment to be "VIM_NOTES:", with the colon appended
      > > to the end. I don't see anything in the Vim help about how to escape
      > > the colon character when creating the definitions for a comment. Does
      > > anyone know how I might escape that successfully?
      > [...]
      >
      > Hmm, I'm not sure. Try it with and without a backslash before the colon.
      > Or see also ":help :let-option". If none of that works, then I'm at the
      > end of my wits: someone else will have to try.
      >
      >
      > Best regards,
      > Tony.
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.