Feature suggestion

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Feature suggestion

Muskoka Auto Parts Limited
-----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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFFuN9/GnOmb9xIQHQRAijaAKC1OyHUg2NPGV7dAtLx7G+AIN712ACgvWc2
Z16WzM4kLdOO1AdOtor1UBk=
=PIic
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Feature suggestion

A.J.Mechelynck
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.
Reply | Threaded
Open this post in threaded view
|

Re: Feature suggestion

Greg Dunn
In reply to this post by Muskoka Auto Parts Limited
On 1/25/07, Brian McKee <[hidden email]> wrote:
> 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.

I think what you want has already been done... Check out
http://www.vim.org/scripts/script.php?script_id=1046

-- Greg
Reply | Threaded
Open this post in threaded view
|

Re: Feature suggestion

Muskoka Auto Parts Limited
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 25-Jan-07, at 1:07 PM, Greg Dunn wrote:

> On 1/25/07, Brian McKee <[hidden email]> wrote:
>> 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.
>
> I think what you want has already been done... Check out
> http://www.vim.org/scripts/script.php?script_id=1046

Yep - that's pretty much what I wanted and more !
I'll pass my additions along to the authour.
Thanks all...

Brian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFFuRJgGnOmb9xIQHQRAlSiAJ0e7H/YS2lCInQhqaY8bXSC204nOgCfUgBC
jZ6ew60MhH3TkRBjCW7GpRA=
=9ytW
-----END PGP SIGNATURE-----