:nnoremap <f2> :w<cr>
---- RANT ----
Though I don't really get the reason why every
command is preceded by colon. It should be one keypress, like
maybe semi-colon. I'm sure the writers of vim were pretty
aware of that, so there must be a design issue they faced or
something that prevented one keypress instead of two (maybe
they wanted to prevent accidental press?). This was just a
rant.
---- END RANT ----
The biggest issues are
1) a lack of keys--vim *really* *does* use _every_ regular
letter, number, punctuation mark, and control-key for *something*
(and freakishly, I use a good majority of them fairly regularly).
Your example of a semicolon? The "search for the next f/F/t/T
search on the line in the same direction as before" command. By
using the colon, it allows arbitrary complexity to be introduced
through longer command-names.
2) a lack of predictable means by which to get the "extended"
keys (such as Fn keys, <home>, <end>, <insert>, alt+character
etc) across the multitude of platforms on which vi/vim runs.
Some of this has stabilized as many terminals have condensed into
a few common ones, but I still have problems with such extended
characters on some connections. And on some platforms, you don't
have the same keys (some keyboards don't have F11 and F12, etc)
However, since Vim doesn't use the extended keys for anything,
they're ripe for remapping according to your platform.
One quick question, please if you could answer: what if I want
to map something like a two keys in succession to something,
like gg for save, gz for quitting and saving. How would it
change?
:nnoremap gg :w<cr>
:nnoremap gz :wq<cr>
I would avoid remapping "gg" as that goes to the top of the
file...something I use *all* the time (and drives me nuts on nvi
when I use it on one of my OpenBSD boxes). I would recommend the
(almost: ":help gs") useless "gs" command for your saving if you
need it:
:nnoremap gs :w<cr>
As mentioned above, "extended" keys are good candidates for
mapping to custom functionality if they come across in your
platform/interface, so you could use
:nnoremap <m-s> :w<cr>
:nnoremap <m-q> :wq<cr>
to make alt+s save and alt+q save+quit. Or use function keys
as mentioned previously such as <f2> to save, and <f4> to
save+quit, with perhaps <s-f4> to quit+abandon, etc.
I'm sorry if my English is bad.. it's not my first language.
It's notably better than most of my non-English (Spanish, ASL,
and some Latin are the only languages I've taken/learned, and ASL
isn't of much use on a mailing list :) so have non fear. You're
understood :)
Hope this helps,
-tim