nlist.vim : Vim global plugin for adding line numbers
| script karma
Downloaded by 1176
Comments, bugs, improvements
script versions (upload new version)
This provides a command and a function. They both can be called with or
without a range. In addition, they can be called with or without arguments.
Without a range they operate on the current line. The arguments are described
arg1 -> the number to start at. The default is one. This will
number your selected lines sequentially. The start can be a
number, ., $, or, 'x (like getline).
arg2 -> Text to append after numbers. The default is a space.
arg3 -> Controls formatting. Can be "left", "right", or "none". The
default is "right".
To make a list start at 1:
To number the whole buffer (with it's actual line number):
To number a subset of lines with their line number (and put a '] ' in
front of every number):
:'<,'>Nlist . ]\
:'<,'>call Nlist(".", "] ")
To number the whole buffer (with it's actual line number) without
:%Nlist 1 \ left
:%call Nlist("1", " ", "none")
Example mappings that a user can define:
nnoremap <unique> <Leader>N :%Nlist<cr>
vnoremap <unique> <Leader>N :Nlist<cr>
Click on the package to download.
ip used for rating: 18.104.22.168