Vim: set langmap=e;h breaks supertab plugin

て烟熏妆下的殇ゞ 提交于 2019-12-05 08:22:05

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.

Dettorer

I had the same problem, but this workaround didn't fit my case, so I posted my own question and someone made a patch that fixes it:

Vim langmap breaks plugin (bépo)

https://groups.google.com/forum/#!msg/vim_dev/QnNwLWhJ744/1qNcD7d9OvgJ (see the last message)

This patch introduces a new setting: langnoremap which, when set, prevents langmap from affecting such mappings.

It may need some more testing and may not be included in vim very soon, but it seems to work quite well!

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!