Saturday, October 30, 2010

Re: selection to upper case or lower case

On Sat, Oct 30, 2010 at 02:38:21PM +0400, ZyX wrote:
> Reply to message «selection to upper case or lower case»,
> > What I want is to:
> > 1) Select a piece of code.
> > 2) Press <Shift-F3> and make it upper case.
> > 3) Press <Shift-F3> again to change it to lower case. (So a toggle
> > function)
> If you want to toggle upper/lower (so that `Ul' becomes `uL'), use
> vnoremap <special> <S-F3> ~
> if you want to toggle upper/lower based on character under cursor, use
> vnoremap <expr> <special> <S-F3> ((matchstr(getline('.'), '^.', col('.')-1)=~#'\u')?
> ('gu'):('gU'))

If I remember correctly, keybindings like Shift-Fn are recognized only
by gvim, not by terminal vim (because of limitations of the terminal
emulator, e.g., xterm or konsole)

Using ~ to toggle the case of text seems more simple to type for me.

--
Javier Rojas

GPG Key ID: 0x24E00D68

No comments: