Tuesday, March 2, 2010

Re: can I configure the "default" commands?

On 02/03/10 09:13, Jorge Timón wrote:
> Thank you very much. index.txt is what I needed, althought it seems to
> be bigger than I first thought.
> So I can just map "on top" of this default settings, being careful of
> what mode I'm mapping to.
> I guess I'll just map keys in normal mode anyway.
> if I want to map, for example, u to k and k to l, what should be the
> order? Can I do that?
> In this case, I've hide the "Undo" function, since the u key will
> perform the "Up" function (I don't know if it's correct to call them
> functions, but I think you understand me).
> Is there a way to know if you've hide any key after mapping?
> Have the keys in index an equivalent Ex command?
>
> Thank you

If you want to make the u key act as if it were k, and k act as if it
were l, then use

:noremap u k
:noremap k l

The order in which you define the mappings is irrelevant, but in this
case it is important to use :noremap (at least for u to k) so that the
result is not mapped again.

To know if the {lhs} of a mapping hides a default key binding, check the
help, in this case

:help u
:help k

To use Normal-mode keys in an ex-command (e.g. in a script), see

:help :normal

Some of the key bindings also have equivalent ex-commands (e.g. :wincmd
for Ctrl-W ) but that depends on the particular Normal-mode key binding.


Best regards,
Tony.
--
The scum also rises.
-- Dr. Hunter S. Thompson

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