user2663398
user2663398

Reputation: 63

How can I detect which file maps this key in vim?

Using vim, I found that some key is mapped to something I didn't do that.

When press TAB, vim does strange movement.

shown after checking with :imap<CR>

i <Tab>      * pumvisible() ? "\<C-N>" : "\<TAB>"
i <Tab><Tab>   <ESC>o

I want to remove that things.

But I have no idea about where these are from.

How can I detect exact file which mapped these?

I use Listmaps, but in the result, there is no map about this.

and also tried grep like:

$grep -r 'map <Tab>' ~/.vim

only got no results.

Sorry for short English, thanks in advance!

Upvotes: 2

Views: 110

Answers (2)

freeo
freeo

Reputation: 3669

Mappings are saved locally to each file, which you used, when entering these maps. You could try using :unmap (:[nixo]unmap) to delete these mappings, which often times didn't work for me.

What works is deleting your vim views files, which store this option and many more associated to specific files. Delete all to completely get rid of your old mapping! (Backup, just in case)

Default directories are

$VIM/vimfiles/view (windows)
~/.vim/view (unix)  

See :h viewdir for the complete help.

Upvotes: 0

romainl
romainl

Reputation: 196566

Use the :verbose command:

 :verbose imap <tab>

Upvotes: 6

Related Questions