Brian McKee wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi All,
Please correct me if I've missed something.
I see where sponsorship allows you to vote on new features.
What's the appropriate proceedure for suggesting a feature?
I'm including my suggestion here because somebody's likely to point out
why it stinks - or how to do it now :-)
Control-A to increment numbers is really handy sometimes. How about
adding logical opposites?
i.e. control-a while the cursor is over the word TRUE would make it
flip to FALSE,
on to off, yes to no and vice versa - case preserving of course. It
would be great for lots of config files.
Comments appreciated,
Brian
[PGP signature snipped]
I don't think it stinks; I just think implementing in C wouldn't be worth the
trouble, as it can be implemented in vimscript as a function with (I think) a
sufficient efficiency. Especially in Vim 7 where you can create a Dictionary
such as
let boolvars =
\ { 'true' : 'false'
\ , 'false' : 'true'
\ , 'on' : 'off'
\ , 'off' : 'on'
\ , 'yes' : 'no'
\ , 'no' : 'yes'
\ }
etc. The case variants (true, True, TRUE) could be handled either by
multiplying the entries or by software, I haven't gone very deep into the
analysis. The special case of Booleans expressed as Numbers (0 => 1, anything
else => 0) can be handled separately. Then you could invoke the function from
a mapping.
Of course a different version would be needed for every supported language:
with some cases such as Dutch ja=>nee, nee=>ja, neen=>ja; French en<=>hors
(but only before "circuit", "service" etc.)
Best regards,
Tony.