Friday, May 7, 2010

Re: naming convention of shortcut keys in vim

On May 6, 8:44 pm, Peng Yu <pengyu...@gmail.com> wrote:
>
> I think there are filetype dependent commands/mappings. That is,
> certain commands/mappings will be available for certain file types.
> Even if I found a command/mapping is not available in gvim (without
> opening any files), will it be available for some file types?
>

Yes, these could exist, they would be part of a plugin.

You could :set filetype={filetype you're interested in} and then
use :map and :map! to determine any filetype-specific mappings, and
potentially :command to list commands that may be defined. If you type
in the first few letters of the command you're interested in, you can
use tab-completion or CTRL-D to list all that match something
specific.

There's this:

http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_Tutorial_%28Part_2%29#Finding_unused_keys

Anyway, if it's in a filetype plugin, and you accidentally use the
same keys in your .vimrc or another plugin, you'll either get errors
in the filetype plugin which you can see, or they will silently
override your own mappings, rather than the other way around. So it
will be pretty easy to discover.

If you find that your mapping or command is overwritten, use :verbose
map or :verbose command to tell you where it got overwritten.

In general, mappings are probably more likely to get overwritten than
commands, especially if you follow a naming convention like {plugin
name}CommandName so that there is little chance of overlap.

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