Skip to content

vim-scripts/InsertList

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

This is a mirror of http://www.vim.org/scripts/script.php?script_id=2788

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

About

Insert number-list.

Resources

Stars

Watchers

Forks

Packages

No packages published