为什么< C-PageUp>和< C-PageDown>在vim中不起作用?

问题描述:

我在Windows上安装了Vim 7.2.在GVim中,默认情况下,<C-PageUp><C-PageDown>用于在选项卡之间导航.但是,它不适用于Vim.

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.

我什至在_vimrc中添加了以下几行,但仍然无法正常工作.

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>

有人知道为什么吗?

您描述的问题通常是由于vim的终端设置不知道给定键的正确字符顺序引起的(在控制台上,所有击键都变成一个序列字符).也可能是由于您的控制台未为您要按的键发送不同的字符序列.

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>

<CTRL-V><CTRL-PAGEUP>实际上是那些键,而不是小于,C,T,R等.".

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

如果是后一个问题,则需要调整终端程序的设置或获取其他终端程序. (我不确定这些选项中的哪个实际上在Windows上存在.)

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