Why do <C-PageUp> and <C-PageDown> not work in vim?

dictionary, tabs, vim

Solution

The problem you describe is generally caused by vim's terminal settings not knowing the correct character sequence for a given key (on a console, all keystrokes are turned into a sequence of characters). It can also be caused by your console not sending a distinct character sequence for the key you're trying to press.

If it's the former problem, doing something like this can work around it:

:map <CTRL-V><CTRL-PAGEUP> :tabp<CR>

Where `<CTRL-V>` and `<CTRL-PAGEUP>` are literally those keys, not "less than, C, T, R, ... etc.".

If it's the latter problem then you need to either adjust the settings of your terminal program or get a different terminal program. (I'm not sure which of these options actually exist on Windows.)

Problem

I have Vim 7.2 installed on Windows. In GVim, the `<C-PageUp>` and `<C-PageDown>` work for navigation between tabs by default. However, it doesn't work for Vim. I have even added the below lines in `_vimrc`, but it still does not work. ``` map <C-PageUp> :tabp<CR> map <C-PageDown> :tabn<CR> ``` But, map and works. ``` map <C-left> :tabp<CR> map <C-right> :tabn<CR> ``` Does anybody have a clue why?

Original source