set pastetoggle not working

蓝咒 提交于 2019-12-05 12:25:24

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>.

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>

The easier fix is of course to just change your terminal type to something that allows vim to work without jumping through hoops.

You have set noesckeys in your vimrc.

I've read a long time ago (no source, sorry) something about function keys being interpreted as <Esc>number in some terminals (<Esc>9 for <F9>).

If I'm correct and if I read :help noesckeys correctly, set noesckeys is blocking all function keys. Try commenting it out.

(Very late answer I know but someone else may find this useful)

I encountered the same problem (Vim7.4 on OSX10.9.5) and what worked for me was to set pastetoggle after setting nocompatible (nocp).

I found that on Macs the F2 key is mapped to "Turn Do Not Disturb On/Off". You can disable this setting under System Preferences -> Keyboard -> Shortcuts -> Mission Control. Uncheck the checkbox or pick another key. Picture below

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