我是Vim的新手并尝试设置一些插件.到目前为止,我已经安装了病原体,pyflakes和supertab.后者似乎不起作用; tab在插入模式下按下只需写入字符串<Plug>SuperTabForward.
问题只发生在我的vimrc中的以下行(为了更好地使用colemak布局导航):
set langmap=hjklneiHJKLNEI;kniejhlKNIEJHL
Run Code Online (Sandbox Code Playgroud)
如果没有上述线路,它就可以正常工作.经过进一步的实验,我把它缩小到了set langmap=e;h.这条单行突破了supertab.
我对Vim完全缺乏经验,无法了解正在发生的事情或如何解决问题.即使是变通方法也会引起关注.
我找到了一个解决方法:编辑,用supertab.vim替换 的实例,这会导致字符串变成。<Plug>SuperTab<P>P<Plug>SuperTabForward<P>PForward
我认为它有效是因为这些字符串不再包含 中涉及的任何字母set langmap=hjklneiHJKLNEI;kniejhlKNIEJHL。有几个问题尚未解决。langmap 有问题吗?对我来说,似乎明确存在该选项以允许仅影响命令的映射:
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.
Run Code Online (Sandbox Code Playgroud)
那么,字符串中存在 langmap 映射字符(imap即插入模式映射)有什么区别,对我来说毫无意义。如果是这样,它将随机破坏任何使用长字符串的插件,例如 SuperTab imap。只是为了说明这是多么奇怪,如果我这样做imap no yes,则jo需要编写才能使其触发。我不知道其背后的逻辑是如何运作的。