On 10/11/08 12:15, Pento wrote:
> Hello, everybody!
>
> Now for map shortcut for example for :ls in 3 modes I need to add 3
> lines to my ~/.vimrc:
>
> " F5 - show buffers
> nmap<F5> :ls<cr>:b
> imap<F5> <esc>:ls<cr>:b
> vmap<F5> <esc>:ls<cr>:b
>
> How can I do this in one line?
>
> "map!<F5> <esc>:ls<cr>:b" is not works in normal mode :(
You can't (well, unless you want to use the | bar to write several
commands on a single line, but using that with the mapping commands is
twitchy).
Using ":map" with no (n, v, etc.) prefix and with no exclamation mark
will create a mapping for all submodes of Normal, Visual and
Operator-pending, but Insert/Replace and/or Command-line require a
separate mapping. In addition, in this case you want for Visual mode a
different replacement text than for Normal mode, so I don't think you
can use less than three mapping commands.
Best regards,
Tony.
--
We may hope that machines will eventually compete with men in all
purely intellectual fields. But which are the best ones to start
with? Many people think that a very abstract activity, like the
playing of chess, would be best. It can also be maintained that it is
best to provide the machine with the best sense organs that money can
buy, and then teach it to understand and speak English.
-- Alan M. Turing
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---