Tuesday, 22 December 2009
Number Each Line of Current File
to merely display numbers
:set number
following will actually insert numbers but relies on external Linux utility nl
:new | r!nl # (where hash is alternate file name)
Vim Way
:%s/^/\=line('.'). ' '
Labels: numbering lines
Subscribe to Posts [Atom]
Post a Comment