Sunday, January 30, 2011

Re: How do the default key commands work

On 01/30/11 03:25, Marco wrote:
> there are just the definded mappings listed, not the basic
> built-in commands like »%«, »e« or »w«.

The natively functionality for these is defined in C functions
and mapped in Vim's source-code.

If you want a catalog of the functionality, you can look at
things like

:help normal-index
:h visual-index
:h insert-index
:h ex-cmd-index
:h ex-edit-index

or more generically:

:h index.txt

They're available "natively" from within a "noremap" version of a
mapping. So if you want to swap the functionality of "j" and "k"
(wow, that would get annoying, but it's a good example), you can use

:nnoremap j k
:nnoremap k j

If you didn't use the "nore" version, then the 2nd one would
produce a recursive mapping:

:nmap j k " now both j & k act like k
:nmap k j " now k calls j calls k calls j calls k...boom

Hope this makes sense. There's no underlying function (like I
understand Emacs has) accessible to which keys can be rebound.

-tim

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

Post a Comment