sponsor Vim development Vim logo Vim Book Ad

nlist.vim : Vim global plugin for adding line numbers

 script karma  Rating 114/38, Downloaded by 1110    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
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
nlist.vim 2.0 2003-07-02 6.0 brian medley Alphabetic numbering like a b c .... y z aa ab ac added by Seib.
nlist.vim 1.0 2001-10-01 6.0 brian medley Initial upload
ip used for rating: 54.81.76.147

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo