On Wed, 7 Jun 2006, Charles E Campbell Jr wrote:
Gerald Lai wrote:
Visincr pads trailing spaces as the number of characters needed to
represent the end number increases. What I mean is, for the above
example, we will be left with:
cities[0 ] = ...
.
.
cities[2039] = ...
Could it be made to pad nothing? Or, in addition, even leading
zeros/spaces/other characters?
Also, are there plans for incrementing/decrementing hex & octal?
As of v13, a zfill of '' or "" will work to "pad nothing":
:[visual-block range]II 1 ""
You may use other characters, too.
As of v14b, the :IX (and :IIX) commands do hexadecimal incrementing.
I haven't done octal (yet). Guess that'll be :[visual-block range]IO (and
IIO).
Version v14b is available at my website:
http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
as "Visual Incrementing".
Thanks! I'll install it on my next update cycle. Keep up the good work
:)
1. Can (and should) zfill be made into a global option? I'd imagine most
people would prefer to "pad nothing".
2. How about leading zfills? For example:
cities[0000] = ...
cities[0001] = ...
.
.
cities[2039] = ...
--
Gerald