Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: set langmap=e;h breaks supertab plugin

Tags:

vim

colemak

I am new to Vim and trying to set up some plugins. So far I have installed pathogen, pyflakes and supertab. The latter does not seem to work; pressing tab while in insert mode simply writes the string <Plug>SuperTabForward.

The problem only occurs with the following line in my vimrc (for better navigation using colemak layout):

set langmap=hjklneiHJKLNEI;kniejhlKNIEJHL

Without the above line it works just fine. After further experiments I've narrowed it down to set langmap=e;h. This single line breaks supertab.

I am entirely too inexperienced with Vim to have the faintest idea of what is going on or how to fix it. Even a workaround would be of interest.

like image 312
llano Avatar asked Oct 25 '11 12:10

llano


1 Answers

I figured out a workaround: Editing supertab.vim, replacing instances of <Plug>SuperTab with <P>P, which causes strings like <Plug>SuperTabForward to become <P>PForward.

I reckon it works because those strings no longer include any of the letters involved in set langmap=hjklneiHJKLNEI;kniejhlKNIEJHL. Several issues are unresolved still. Is langmap bugged? To me it seems the option exists explicitly to allow mapping that effects only commands:

When you are typing text in Insert mode the characters are
inserted directly.  When in command mode the 'langmap' option takes
care of translating these special characters to the original meaning
of the key.  This means you don't have to change the keyboard mode to
be able to execute Normal mode commands.

It makes no sense to me what so ever, then, that the presence of a langmap mapped character in an imap string, that is an insert mode mapping, makes any difference. If it does, it will randomly break any plugin such as SuperTab that uses long imap strings. Just to illustrate how strange this is, if I do imap no yes, writing jo is necessary to make it trigger. I have no idea how the logic behind that works.

like image 108
porgarmingduod Avatar answered Oct 04 '22 05:10

porgarmingduod