Skip to content

RRethy/vim-indexor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

indexor.vim

Indexor.vim is a plugin for adding indices to a list of items without having to tediously type them in yourself or using a complicated macro with .

Consider have a grocery list as follows:

Bananas
Oranges
Milk
Maple Syrup
Dried Mango
Bananas
Oranges
Milk
Maple Syrup
Dried Mango
Bananas
Oranges
Milk
Maple Syrup
Dried Mango

We can add numbers to this list by highlighting these lines in visual mode and using :AddNumberedIndexes which results in the following:

 1. Bananas
 2. Oranges
 3. Milk
 4. Maple Syrup
 5. Dried Mango
 6. Bananas
 7. Oranges
 8. Milk
 9. Maple Syrup
10. Dried Mango
11. Bananas
12. Oranges
13. Milk
14. Maple Syrup
15. Dried Mango

There is support for upper and lower case romand numerals with :AddLowercaseNumeralIndexes and :AddUppercaseNumeralIndexes respectively which results in the following:

   i. Bananas
  ii. Oranges
 iii. Milk
  iv. Maple Syrup
   v. Dried Mango
  vi. Bananas
 vii. Oranges
viii. Milk
  ix. Maple Syrup
   x. Dried Mango
  xi. Bananas
 xii. Oranges
xiii. Milk
 xiv. Maple Syrup
  xv. Dried Mango

and

   I. Bananas
  II. Oranges
 III. Milk
  IV. Maple Syrup
   V. Dried Mango
  VI. Bananas
 VII. Oranges
VIII. Milk
  IX. Maple Syrup
   X. Dried Mango
  XI. Bananas
 XII. Oranges
XIII. Milk
 XIV. Maple Syrup
  XV. Dried Mango

There is also support for upper and lower case letters with :AddLowercaseLetterIndexes and :AddUppercaseLetterIndexes respectively which results in the following:

a. Bananas
b. Oranges
c. Milk
d. Maple Syrup
e. Dried Mango
f. Bananas
g. Oranges
h. Milk
i. Maple Syrup
j. Dried Mango
k. Bananas
l. Oranges
m. Milk
n. Maple Syrup
o. Dried Mango

And

A. Bananas
B. Oranges
C. Milk
D. Maple Syrup
E. Dried Mango
F. Bananas
G. Oranges
H. Milk
I. Maple Syrup
J. Dried Mango
K. Bananas
L. Oranges
M. Milk
N. Maple Syrup
O. Dried Mango

Commands

Command List
AddNumberedIndexes Add Numbers as indexes to the start of the line
AddLowercaseLetterIndexes Add Lowercase letters as indexes to the start of the line
AddUppercaseLetterIndexes Add Uppercase letters as indexes to the start of the line
AddLowercaseNumeralIndexes Add Lowercase Roman Numerals as indexes to the start of the line
AddUppercaseNumeralIndexes Add Uppercase Roman Numerals as indexes to the start of the line

Installation

Install using your favorite package manager.

  • vim-plug
    1. Add Plug 'RRethy/vim-indexor' to .vimrc/init.vim
    2. Run :PlugInstall

License

Copyright (c) Adam P. Regasz-Rethy. Distributed under the same terms as Vim itself. See :help license.

About

indexor.vim - Vim plugin for indexing lists

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published