Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set pastetoggle not working

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.

In iterm2, nothing happens when I am in normal or visual mode. When I am in insert mode, <F2> is inserted.

My config works perfectly well on my mac mini and linux netbook, but this is throwing me for a loop.

like image 533
Jorbin Avatar asked Dec 27 '22 12:12

Jorbin


1 Answers

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.

like image 194
Mark Carey Avatar answered Jan 29 '23 01:01

Mark Carey