sponsor Vim development Vim logo Vim Book Ad

InsertList : Insert number-list.

 script karma  Rating 0/0, Downloaded by 506  Comments, bugs, improvements  Vim wiki

created by
Shingo Sato
 
script type
utility
 
description
Function:
------------
This plugin inserts input-string before select position, and increments last-number.

Usage:
------------
Execute vim script in selected area (with Visual Mode).
Plugin will be used for create following number-list.

number-list
--------------------------
1.
     1.1.
         1.1.1.
         1.1.2.
         1.1.3.
         1.1.4.
     1.2.
     1.3.
     1.4.
     1.5.
     1.6.
2.
     2.1.
     2.2.
     2.3.
     2.4.
--------------------------

------------------------------------------------------------------------------
[command format]
:'<,'>INSERTLIST numberlist
   or
:'<,'>InsertList numberlist

ex1:
========================================
before text
------------


------------

(1) Please use "Visual mode blockwise", and select following text area.
------------
|
|
------------

(2) Input following command.
:'<,'>INSERTLIST 1.

after text
------------
1.
2.
------------
========================================
ex2:
before text
------------
aaa
bbb
------------

(1) Please use "Visual mode blockwise", and select following text area.
------------
aaa|
bbb|
------------

(2) Input following command.
:'<,'>INSERTLIST 1.

after text
------------
aaa1.
bbb2.
------------
========================================
ex3:

before text
------------


------------

(1) Please use "Visual mode blockwise", and select following text area.
------------
|
|
------------

(2) Input following command.
:'<,'>INSERTLIST strName[0] =

after text
------------
strName[0] =
strName[1] =
------------
========================================
ex4:

before text
------------


------------

(1) Set following option.
:set virtualedit=all

(2) Please use "Visual mode blockwise", and select following text area.
------------
    |
    |
------------

(3) Input following command.
:'<,'>INSERTLIST 1.

after text
------------
    1.
    2.
------------
========================================
ex5: Other input-string format pattern.

(1) 1.1 to 1.N
(2) 1-1 to 1-N
(3) <1> to <N>
(4) 001 to 00N
 
install details
1. Copy the InsertList.vim file to one of the following directories:
       $HOME/.vim/plugin     - Unix like systems
       $HOME/vimfiles/plugin - MS-Windows
       $VIM:vimfiles:plugin  - Macintosh
       $VIM/vimfiles/plugin  - All
 

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
InsertList.vim 1.1 2009-09-16 7.0 Shingo Sato I modify following problem.

(1) If you install the YankRing.vim, insertlist.vim update Yank history.
ip used for rating: 3.141.31.240

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.
   
Vim at Github