GVim:Shift + 插入转储 <S-Insert> 而不是剪贴板文本

Phu*_*yen 6 gvim ubuntu ubuntu-10.10

在 gVIM 中编辑时,每当我按 Shift+Insert 时,它都会插入 <S-Insert> 文本。我在 Ubuntu Maverick 上运行并从源代码编译 Vim。这真的很烦人。我的 VIM 有什么问题?

use*_*686 9

没什么,Vim 只是没有绑定这个按键。

:map <silent> <S-Insert> "+p
:imap <silent> <S-Insert> <Esc>"+pa
Run Code Online (Sandbox Code Playgroud)

如果这有帮助,请将以下内容添加到您的~/.vimrc

if has("gui_running")
    map  <silent>  <S-Insert>  "+p
    imap <silent>  <S-Insert>  <Esc>"+pa
endif
Run Code Online (Sandbox Code Playgroud)

另见:registers, x11-selection,quoteplus


小智 5

我发现Shift+Insert如果处于活动状态,则在 gVim 中不起作用:set paste。它将插入文本“ <S-Insert>”,而不是插入剪贴板内容。普通(控制台)vim 不会遇到这个问题,可能是因为在这种情况下,shift-insert 是一个终端操作,而不是由 Vim 处理的操作。

我的解决方案是关闭粘贴模式::set nopaste