sponsor Vim development Vim logo Vim Book Ad

IncRoman.vim : Cope with Roman numbers

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

created by
Andy Wokula
 
script type
utility
 
description
Increase or decrease a Roman number found under the cursor, with [count].
If a decimal number is found it is converted into its corresponding Roman
number, ignoring the [count].  Any other word is converted to the Roman
number that [count] corresponds to.

Range: I .. MMMCMXCIX (1..3999)
Higher numbers result in more than three "M"s.

There are interface mappings: <plug>IncRoman and <plug>DecRoman .
They can be mapped globally or local to buffer, the latter is the default.
From the script:
    nmap <unique><buffer> <C-A> <plug>IncRoman
    nmap <unique><buffer> <C-X> <plug>DecRoman

Therefore if you want to use the script as a plugin, you should define
global keys in your .vimrc:
    nmap <C-A> <plug>IncRoman
    nmap <C-X> <plug>DecRoman

Other scripts with support for Roman numbers:
vimscript #197 genutils : General utility functions
    genutils#Roman2Decimal(str)
vimscript #431 VimFootnotes : Insert various types of footnotes
vimscript #670 VisIncr : Produce increasing/decreasing columns of numbers, dates, or daynames
vimscript #2120 speeddating.vim : Use CTRL-A/X to increment dates, times, and more

Last Change: 2007 Jan 11
 
install details
Three options: (v2 of the script)
(1) Activate for current buffer:
:source incroman.vim

(2) Use as a plugin.  Then you need global mappings (see description).

(3) Source from an ftplugin.
 

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
incroman.vim 2 2007-01-26 6.0 Andy Wokula now can be used globally and locally, avoids global var for the count
incroman.vim 1 2006-07-17 6.0 Andy Wokula Initial upload
ip used for rating: 3.141.30.162

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