Saturday, June 16, 2012

Re: VIM: best way to swap the Caps and esc, but JUST for vim

On 17/06/12 05:25, ping song wrote:
>
>
> On Sun, Jun 17, 2012 at 10:18 AM, ping song <songpingemail@gmail.com
> <mailto:songpingemail@gmail.com>> wrote:
>
> experts:
> this might be an old topic...but surprisingly I don't get a good
> answer from google easily...
> in my work I use linux and I already swapped the esc/caps with
> xmodmap, so I don't have issue to do it for the whole computer (not
> just for vim).
> but from time to time I need to borrow another windows PC, running
> cygwin terminal, ssh into my linux and work inside vim.
> I don't want to affact other users/apps since this is not just my PC...
> what's the best practice so far to just swap the 2 keys for VIM? or
> at least, change caps to esc.
> most/all answers I got involves a system-wide configuration...
> thanks!
>
> regards
> ping

Vim is not aware of the status of the CapsLock key, so there's no way
(AFAICT) to do what you want from inside Vim.

There might be a way to do it temporarily on the Windows PC you're
running from, by wrapping your ssh call to Vim inside a shell script,
swapping the keys at the start and swapping them back at the end, but
I'm not sure of the details. And you might (or might not, I'm not sure)
have to do some manual cleanup if your cygwin session crashes (or gets a
BSOD) in the middle of a Vim edit.


Best regards,
Tony.
--
LAUNCELOT: At last! A call! A cry of distress ...
(he draws his sword, and turns to CONCORDE)
Concorde! Brave, Concorde ... you shall not have died in vain!
CONCORDE: I'm not quite dead, sir ...
"Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment