Re: Caps Lock
- On Tue, 1 Nov 2005 at 12:49pm, Moshe Kaminsky wrote:
> * Robert Cussons <r.cussons@...> [01/11/05 12:29]:
> > Hi all,
> > don't know how difficult or possible this is to do, but here goes!
> > I sometimes want to write a large amount of test in capitals so I turn on
> > Caps Lock, but then I want to use commands and forget that Caps Lock is on
> > and obviously get unexpected results. Is there a way to get Vim to ignore
> > Caps Lock when in command mode, but still allow me to press <shift> + o for
> > example to get O in command mode, with Caps Lock on. Example to clarify the
> > above:
> > I am typing away with Caps Lock on, then I enter command mode and want to
> > in a blank line above the one I am on, so I want the command for this toYep, that is what came into my mind too. You should really use a "soft"
> > still be <shift> + o, even though I have Caps Lock turned on.
> > Hope at least someone can understand what I mean!
> Maybe instead of pressing Caps, you should :imap any non capital letter
> to a capital one. Then, when you are done, unmap it. All this should be
> done by a suitable command, of course.
version of capslock, implemented in Vim. Something like to start with:
let g:capslock = 0
let diff=lc - char2nr('A')
let c = lc
while c < (lc+26)
exec 'inoremap' nr2char(c) nr2char(c-diff)
exec 'iunmap' nr2char(c)
let c = c + 1
let g:capslock = !g:capslock
nnoremap <silent> \cl :call ToggleCaps()<CR>:echo "Caps lock is
Extending this to all keys would require more sohisticated mapping.
Yahoo! Mail - PC Magazine Editors' Choice 2005