wbrucek
wbrucek

Reputation: 166

Resolving a vim plugin mapping conflict - mapping already exists for \t

I followed http://sontek.net/blog/detail/turning-vim-into-a-modern-python-ide#intro to install a bunch of plugins for Python programming in gvim (installed on a Windows 8 machine). It appears that there is a mapping conflict between the 'command-t' and 'tasklist' plugins, as I get the following error message:

>Error detected while processing C:\Users\Willem\vimfiles\bundle\tasklist\pl
>ugin\tasklist.vim:
>
>line  369:
>
>E227: mapping already exists for \t

Then I type :map in vim and see that one mapping is:

>n   \t             * :CommandT<CR>

Is there a good way to resolve this?

Upvotes: 11

Views: 5811

Answers (3)

edi9999
edi9999

Reputation: 20554

Here's a more general explanation:

From the vim Help:

Both <SID> and <Plug> are used to avoid that mappings of typed keys interfere with mappings that are only to be used from other mappings. Note the difference between using <SID> and <Plug>:

<Plug> is visible outside of the script. It is used for mappings which the user might want to map a key sequence to. <Plug> is a special code that a typed key will never produce. To make it very unlikely that other plugins use the same sequence of characters, use this structure: scriptname mapname In our example the scriptname is "Typecorr" and the mapname is "Add". This results in "TypecorrAdd". Only the first character of scriptname and mapname is uppercase, so that we can see where mapname starts.

So If you want that the error doesn't appear, you need to map something to <Plug>Tasklist in your sample.

Like this:

nnoremap <leader>v <Plug>TaskList

Upvotes: 2

Xavier T.
Xavier T.

Reputation: 42228

Another, maybe imperfect, solution would be to directly edit tasklist.vimaround line 369 and manually change the mapping that is done there.

Upvotes: 1

FDinoff
FDinoff

Reputation: 31429

tasklist will not map to <leader>t if a mapping to <Plug>TaskList is found.

So you just need to create a mapping to <Plug>TaskList in your vimrc. The example I found in the source code was

nnoremap <leader>v <Plug>TaskList

Upvotes: 9

Related Questions