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

RE: putting line numbers into text

Expand Messages
  • Michael Geddes
    %s/^/ =line( . ). : ... From: jonah [mailto:jonahgoldstein@sbcglobal.net] Sent: Monday, 30 June 2003 2:45 AM To: vim Subject: putting line numbers into text
    Message 1 of 7 , Jun 29, 2003
    • 0 Attachment
      %s/^/\=line('.').': '

      -----Original Message-----
      From: jonah [mailto:jonahgoldstein@...]
      Sent: Monday, 30 June 2003 2:45 AM
      To: vim
      Subject: putting line numbers into text


      I wanted line numbers drawn directly into my text (to share code with
      people on another mailing list) and I came up with this solution:

      :g/^/exe "normal 0i" . line(".") . ": <esc>"

      where <esc> is an produced (for me, on windows) by hitting
      <ctrl-q><esc>. This worked, but I figured vim might have some simple,
      built in way for doing this, since it's probly pretty common.

      Anyone know?

      thanks,
      jonah
    Your message has been successfully submitted and would be delivered to recipients shortly.