Set pastetoggle not working

My vim installation ( https://github.com/aaronjorbin/.vim ) contains set pastetoggle=<F2> , but fn + F2 (when vim works in the terminal) forces vim to enter paste mode and output a Q to its own line ( same behavior when I'm already in insert mode). This is the same if I work on my local machine or if I went to another server.

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

My configuration works fine on my mac mini and linux netbook, but it throws me on a loop.

+4
source share
4 answers

This is probably due to the fact that your TERM type is set to something other than xterm xterm-color or xterm-256color. I had my Linux kit, for some reason I can’t remember. This caused function keys to send escape sequences instead of being interpreted as function key presses. those. F2 sent ^[OQ instead of <F2> .

If you need this type of terminal, you can change your .vimrc to use the necessary key by pressing <ctrl-v><F2> instead of entering <F2>

A simpler solution, of course, is simply to change the terminal type to something that allows vim to work without jumping through hoops.

+4
source

You have set noesckeys in your vimrc.

I read a long time ago (no source, sorry) that the function keys are interpreted as <Esc>number in some terminals ( <Esc>9 for <F9> ).

If I am right, and if I read correctly :help noesckeys , set noesckeys blocks all function keys. Try commenting on this.

+3
source

(A very late answer that I know, but someone might find this useful)

I ran into the same problem (Vim7.4 on OSX10.9.5), and pasty-workpiece installation worked for me after installing nocompatible (nocp).

0
source

I found that on Macs, the F2 key is mapped to "Turn Do Not Disturb On / Off." You can disable this option in the "System Preferences" β†’ "Keyboard" β†’ "Shortcuts" β†’ "Mission Control". Uncheck the box or select a different key. Figure below enter image description here

0
source

Source: https://habr.com/ru/post/903033/


All Articles