nlist.vim : Vim global plugin for adding line numbers
script karma |
Rating 114/38,
Downloaded by 1745 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
brian medley |
|
script type |
utility |
|
description |
Description: 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 below:
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".
Examples: To make a list start at 1: :'<,'>Nlist :'<,'>call Nlist() To number the whole buffer (with it's actual line number): :%Nlist :%call Nlist() 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 justification: :%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> |
|
install details |
cp ~/.vim/plugin |
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 3.147.73.112
|