Forums

Mapping of F-keys in vim

Mapping of F-keys and other keys currently does not work for me in vim. For instance F2 seems to be delivering ^OQ F3 ^OR. map <F2> :NERDTree therefore does not work. It seems to be related with the ^V problem but in this case a simple delete of the extra character doesn't help :-) Does anyone have an idea?

Hmm, interesting. A quick test internally here had F1 and F2 not working, and F5 and F6 working. Do you see the same?

Partially, but same behaviour across browsers. F6 is working, F1-F4 do not. F5 does not work for me. Also I am having troube with mapping <A-d> for instance. <BS> however seems to work.

Which browser/OS are you using?

I tried Windows 8 Chrome and IE and Ubuntu 13.04 Chrome. Same behavior. I could try MacOS or Firefox if needed.

Hmm, interesting that F5 didn't work for you -- we tested it in Chrome on Ubuntu -- but either way I think the function key thing needs to go on the list as a bug to fix. Thanks for reporting.

Re: mapping Alt-D -- that sounds odd. I'll ask one of my colleagues who uses vim on PythonAnywhere (I use our HTML5-based editor) to weigh in and we'll see if there's any difference in their config that might help out.

In case of F5 on ubuntu 13.04 I get a ~ and vim switches the case of the next 5 characters. The command is executed regardless of the mode i am in. Same for F1-F4. As for the ALT key it is really strange: mapping <a-i> to :nohl (<cr> intentionally left out for debbuging) gives me a window beep and puts me to insert mode even when pressed from :prompt. This behaviour does appear with no .vimrc file present. However viewing the maps shows a different behavior between no vimrc file and my current config. In my config <A-i> is shown as french e accent aigu( é ). htp