Friday, January 28, 2011

Re: Remapping CTRL-I to

On Fri, Jan 28, 2011 at 07:48:21AM EST, Tim Chase wrote:

[..]

> As others have mentioned, using ^I is a tough choice because it's usually
> treated as a <tab>.

One thing I haven't looked at is using the underlying XTerm's Xresources
to remap CTRL-I. In theory, I would then be able to limit the scope of
this customization to a single XTerm by using its '-name' command-line
flag to run it under a different name and thus customize its keyboard
map. Unfortunately, I run pretty much everything under a single instance
of XTerm multiplexed via GNU/screen.. so where I'm concerned, the change
would pretty much be 'system-wide' anyway.

> However there are other keys that may be accessible on your laptop.
> I happen to have <F1> remapped to <esc> as well because they're so
> physically close (and if I want help, I know to ask for it at the
> command-line) it's easy for me to mash a finger in the top-left of my
> keyboard to hit one of them.

That's precisely the problem I am running into with this new laptop: the
folks at Lenovo have placed the <Esc> key ais ll by itself above the
function keys row. But in any case, I tend to use function key mappings
only for stuff that I do once in a while (the pastetoggle key is a good
example). Speaking of toggles, I like them for very frequent keyboard
actions especially when they result in switching back and forth between
two keyboard states.. but obviously I couldn't 'imap' the I-key to
escape :-) .. and so I thought that the next best thing would be to use
'i' to switch to insert mode and <modifier>+I to go back to normal mode.

> Alternatively, you could use some other control combination that you
> don't use frequently in insert-mode. Very few folks I know use ^A in
> insert mode (I can only think of about twice in my ~10yrs of vimming
> where it wasn't (a) to learn what it did or (b) to try and weasel down
> a keystroke on vimgolf.com) so it might make a good candidate --
> especially if you've remapped/swapped your control-key and your
> caps-lock key. Another open candidate is ^B which non longer has any
> meaning.

Ah.. i_CTRL-A indeed.. And I thought I knew everything.. :-)

I'll have to decide whether it's worth integrating to my working
habits.. there might be cases where doing a bunch of those in quick
succession might be a valuable timesaver.

Actually, while writing my reply, I tried a:

| :inoremap <Esc>i <Esc>

In my environment, this causes the <Alt+I> combo to send <Esc> to Vim..
and it looks like it might work with no side effects -- I first checked
in insert mode that <Alt+I> did not do anything that I could see and
I don't remember ever using it for anything else (?).

Hm. Touch wood, but this would be perfect.. it's as close as I'll get to
using the <I> key as a toggle.. and for a home-row person like me.. it
works very well indeed in terms of accessibiity.. My left thumb usually
rests on top of the left Alt key.. goody.. goody..!

Thanks to all for your comments. If this holds.. you very much helped
make my day!

cj

--
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