Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim Supertab plugin reverses the direction when navigating completion menu

Tags:

vim

vim-plugin

When I loop through the list of completion alternatives via supertab (i.e. activated by pressing <TAB>), the selection starts at the end of the list and cycles upwards when repeatedly pressing <TAB> or <C-n>. Pressing <S-TAB> or <C-p> cycles downwards.

The opposite behaviour, which I find more convenient, happens when the automatic completion is activated by the vim built-in (?), using <C-x><C-n>. Then <C-n> cycles downwards and <C-p> upwards.

I'm not too knowledgeable about vim. How can I fix this?

like image 800
Patrick Avatar asked Jun 14 '13 09:06

Patrick


1 Answers

This is because SuperTab's default completion is <C-p>, which cycles backwards (so matches before, not after the cursor are presented first, which is usually what you want). As documented, you can change that via:

let g:SuperTabDefaultCompletionType = "<c-n>"

(Put this into your ~/.vimrc.)

like image 183
Ingo Karkat Avatar answered Sep 29 '22 10:09

Ingo Karkat