On 06/02/10 14:31, Miklos Somogyi wrote:
Hello Folks,

I am familiar with vi but new to vim. I used to use the map instruction to do a 
lot of goodies for me.
However, my new keyboard (diNovo Edge for Mac) would not let me program the 
function keys, so
I got interested in vim's abbreviations.

Do you mean none of F1 to F12 with or without Ctrl and/or Alt and/or Shift reaches the program when you hit them? If that's what you mean, I pity you, and I'm tempted to say you got yourself tempted into buying an expensive piece of scrap.

Try the following experiment: Start Vim, then hit the F1 key. Do you see the first page of the Vim help? If you do, then Vim saw your F1 keypress and there's a good chance that it would also see the other function keys, at least when unshifted. They are not assigned any function by default, but you can map them. If F1 brought up the help, then try

        :map <F2> :echo "Jó napot, Miklos!"<CR>

where <F2> and <CR> are four ASCII characters each, and hit the Enter key after the > of <CR> to define the mapping. Then hit F2 and see if Vim doesn't salute you in Hungarian.

Hello Gregor,

Thank you, this is working nicely.
I was looking at lots of things on the net, hoping that I find the definitions 
of things, but information
was scattered around  and examples contained as yet unknown things for me to 
chase.

I don't know what, if any, difference is of <Esc> and <ESC>, between <C-R> and 
<CR>, :abbrev and abbrev and abbr and ab,
nmap and :nmap, between normal mode and command mode, etc, not to talk about the 
<ctrl> things.

<Esc> and <ESC> both are the Escape key, usually near top-left of your keyboard, and to Vim (who picked it from ASCII) the Ctrl-[ combination is an alias for it. <CR> means carriage-return (or the Enter key or, as a Vim [and ASCII] alias, the Ctrl-M combo) but <C-R> means Ctrl-R (hold down Ctrl and hit R). :abbreviate is one particular ex-command in the longest way you can type its name at the keyboard, but you can omit any number of letters at the end as long as you don't make it shorter than :ab . In a script the initial colon may be omitted, and otherwise the same "abbreviated ex-command names" apply. :nmap is another ex-command, and again, in a script the initial colon may be omitted.

Normal mode and command mode are the same, but command-line mode is different, so the expressions "normal mode" and "command-line mode" are preferred to avoid ambiguity.

See:
        :help keycodes
        :help :ab
        :help map-overview
        :help vim-modes

see also what I say below about the Vim help in general, especially about following hyperlinks.

Also, what are the in-built things that you should not override, what do they 
do?

Hm, I have no ready-made exhaustive answer to that, it is largely a matter of: 'f it ain' brok'n, don' fix 't. For instance some people who use Dvorak keyboards have talked about remapping the whole set of Normal-mode key bindings so that whatever is under their fingers in the resting position should map to h j k l, then whatever was initially bound to those four keys be activated by some other keystrokes, et cetera... It can be done, but I think that that particular game is not worth the candle. Use the h j k l keys (wherever located) of your Dvorak keyboard, or use the <Left> <Down> <Up> <Right> key-movement keys on the side, and Vim will understand out of the box. It will even understand mouse clicks (in all GUI versions of Vim, and as a number of compile-time options for the various terminals where Vim can run in console mode). Or you can decide that on Dvorak you use F5 to F8 in Normal mode to mean h j k l respectively. As you will soon see if you stay on this mailing list, most problems in Vim have more than one solution, and often "which one is best" is a matter of taste or of personal preference, rather than of provable objective fact.


I guess, that all of this would fit on just a few pages, but is there such a 
compilation somewhere?
I would be happy if you could point me in the direction of a good documentation 
of vim.


The authoritative documentation on Vim is the set of help files that come bundled with it. The Vim wiki http://vim.wikia.com/ is a useful and often well-written commentary; the vim_use Google group is also a helpful resource (and quite friendly, I'm told, as discussion groups go), but *every single thing* is in the help. Since the day I first used a computer (a big mainframe with 128K RAM, running at a breakneck 667 kHz, in 1969), I've never seen any single piece of software whose online help came to the heel of Vim's. The only docs which could distantly compare were not online: they were the bound paper books documenting the mainframe software of my youth, but in those times you had to sit down and read, have Hollerith cards punched, leave your stack of cards in the queue to be run, and later (on the next day, usually) look at the zigzag printouts and at the teletype console output sheet to see if it had worked. But I'm straying.

This completeness of the Vim help has a downside, though: it can be hard, at first, for a beginner to find his way through the bulk of the help, and he often feels like the young fairytale princess who had lost her golden needle romping in the hay with the farmer's son. But even there Vim offers tools to search the help in several ways.

See among others:
        :help
        :help :help
        :help {subject}
                where {subject} is as shown: two braces
                with seven letters between them.
        :help :helpgrep

about how to use the help, and

        :help doc-file-list
        :help reference-toc
        :help index

for the main indexes and table of contents.

See also
        :help c_CTRL-D
        :help c_<Tab>
        :help 'wildmenu'
        :help 'wildmode'
        :help 'wildchar'
        :help cmdline-completion

about more ways to navigate (among others) the help, since what the latter seems to omit is that completion works for help topics too. (In fact, it works by means of tag files in the directories where help files can be located, so help topic completion is internally handled as a special case of tag completion.)

...and don't forget to follow the hyperlinks, as explained near the top of the page that comes up when you type :help (followed by Enter) or hit F1 (if, of course, that keystroke is passed to the program).


Best regards,
Tony.
--
        A doctor, an architect, and a computer scientist were arguing
about whose profession was the oldest.  In the course of their
arguments, they got all the way back to the Garden of Eden, whereupon
the doctor said, "The medical profession is clearly the oldest, because
Eve was made from Adam's rib, as the story goes, and that was a simply
incredible surgical feat."
        The architect did not agree.  He said, "But if you look at the
Garden itself, in the beginning there was chaos and void, and out of
that, the Garden and the world were created.  So God must have been an
architect."
        The computer scientist, who had listened to all of this said,
"Yes, but where do you think the chaos came from?"

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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to