设置pastetoggle不起作用 [英] set pastetoggle not working
问题描述
我的vim设置( https://github.com/aaronjorbin/.vim )包含set pastetoggle=<F2>
但是fn + F2(当vim在终端中运行时)使vim进入插入模式并在其自己的行上输出Q
(当我已经处于插入模式时,行为相同).如果我在本地计算机上工作,或者已放入另一台服务器,则是相同的.
My vim setup( https://github.com/aaronjorbin/.vim ) contains set pastetoggle=<F2>
yet fn+F2 (when vim is running in terminal) causes vim to enter insert mode and output a Q
on it's own line (same behavior when I am already in insert mode). This is the same if I am working on my local machine or if I have sshed into another server.
在iterm2中,当我处于正常或视觉模式时,什么也不会发生.当我处于插入模式时,将插入<F2>
.
In iterm2, nothing happens when I am in normal or visual mode. When I am in insert mode, <F2>
is inserted.
我的配置在Mac mini和linux上网本上都能很好地工作,但这使我陷入了循环.
My config works perfectly well on my mac mini and linux netbook, but this is throwing me for a loop.
推荐答案
这可能是由于您的TERM类型设置为xterm xterm-color或xterm-256color之外的其他值.由于某种原因,我将我的操作系统设置为linux,我不记得了.这导致功能键发送转义序列,而不是被解释为功能键按下.即-F2正在发送^[OQ
而不是<F2>
.
This is likely due to your TERM type being set to something other than xterm xterm-color or xterm-256color. I had mine set to linux for some reason I can't remember. This caused the function keys to send escape sequences instead of being interpreted as function key presses. ie- F2 was sending ^[OQ
instead of <F2>
.
如果需要该终端类型,可以通过按<ctrl-v><F2>
代替键入<F2>
If you need that terminal type you can change your .vimrc to use the key you want by pressing <ctrl-v><F2>
in place of typing <F2>
当然,更简单的解决方法是将终端类型更改为允许vim正常工作而不会跳到箍上的东西.
The easier fix is of course to just change your terminal type to something that allows vim to work without jumping through hoops.
这篇关于设置pastetoggle不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!