sponsor Vim development Vim logo Vim Book Ad

vim-vsnumber : vim script to make the number sort in selection area

 script karma  Rating 1/1, Downloaded by 775  Comments, bugs, improvements  Vim wiki

created by
rargo ye
script type
vim plugin to make value of number sort in select text,

Usage: use ctrl-v V v to select text,and call vsnumber to make it's value change

for example:
origin text:

select text using ctrl-v( '|' repersents select position):

if call :'<,'>VsNumber 9 1
the result is:
that is the number in select text became sort start from 9, increase by 1

if call :'<,'>VsNumber . -1  ("." mean's change uppon on current value)
the result is:
that is each number in select text sub by 1

It's useful when you has the following text, and you want to correct the suqenuce
1. line1
2. line2
7. line3
6. line4
1. line1
2. line2
3. line3
4. line4

also, useful when you want to make a large suqenuce numbers like below:
enum const_logic {
int value0 = 0,
int value1 = 1,
int value2 = 2,
int value3 = 3,
int value4 = 4,
int value5 = 5,
int value6 = 6,
int value7 = 7,
int value8 = 8,
int value9 = 9,

install details
unzip the file in plugin to your ~/.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
vim-vsnumber.tar.gz 1.0 2013-08-24 7.0 rargo ye Initial upload
ip used for rating:

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.