Tim Chase wrote:
In general, the safest keys to use for the {lhs} (left-hand
side) of mappings are the F keys. Almost everything else
already has a function in Vim. Among
Worth knowing. Thanks. What about when using a leader such as
"," or "/" ?
The comma does a reverse-search of the last thing you searched for using
t/T/f/F which many folks don't use (so they use it for leader), but I
use regularly.
:help ,
:help ;
The forward slash does searching...something used quite regularly.
:help /
I think the only key that isn't reserved (in that Vim doesn't already
have meaning assigned to it) is the backslash, which is what the leader
defaults to (so in a way, it is used...but only for the purpose you
describe). I tend to use the default backslash as my leader (on those
rare occasions I use the leader) because I know it's available and it's
vim-portable.
One other candidate might be the underscore, though it's a shifted key
which makes it a little more difficult, it is usually in a pretty
predictable place (unlike the backslash/pipe key which I find all over
the keyboard depending on whose machine I'm using...makes typing DOS
file-paths a pain).
Just my $0.02
-tim
Even the underscore's location may vary. On my Belgian keyboard it is
shift-minus (at far upper right) but IIRC on French keyboards it is unshifted
8. At least it uses at most only the Shift key (which exists on both sides of
the keyboard, not the AltGr key, as (on my keyboard) both \ and | do; and
since they are at far lower left and far upper left respectively, it makes
them only barely keyable with one hand (I usually use my left hand either to
rest my chin or to hold a book I'm typing from :-) ).
I don't use _ in Vim; it has a function though... move to the first nonblank
of the (count - 1)th line down: sames as +k or <Enter>k
Best regards,
Tony.
--
Did you ever see a "Hit any key to continue" message in a music piece?