RE: putting line numbers into text
- %s/^/\=line('.').': '
From: jonah [mailto:jonahgoldstein@...]
Sent: Monday, 30 June 2003 2:45 AM
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.