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:


Comments:

Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]