在Windows上,在VIM的图形版本中,i使用Control+Shift+Left
(或Right
(在插入模式中选择一个单词。
为了确保没有任何导致失败的东西,我首先停止了任何初始化文件加载:
vim -u NONE
然后,在vim,:behave mswin
中,设置所有这些移位选择等。
为什么它在gvim
中起作用,而在vim
中不起作用。我可以确保我的计算机上没有任何内容,因为我停止了所有脚本,在Vanilla命令提示中运行vim
等,并且仍然不起作用。我也在另一台计算机上重现了问题。
任何人都可以建议吗?
具有Ctrl+Shift+Left
和Ctrl+Shift+Right
的行为,如您的问题所述,您可以尝试:
if has('gui_running')
;
else
inoremap <c-s-left> <c-o>db
inoremap <c-s-right> <c-o>de
endif
这个问题的答案:如何映射ctrl a和ctrl shift a的不同?解释为什么Ctrl-Shift-Key
在某些终端中不起作用。
我发现的是,在控制台VIM中使用:behave mswin
时,您可以使用Shift-Right
选择一个字符,然后使用Control-Right
(即无Shift
(选择下一个单词。
但是,我有使用Control-Shift
选择单词的习惯,因此我编写了以下Autohotkey脚本来启用这一点:
SetTitleMatchMode 2 ; for partial matching of Window Title
#If WinActive("ahk_exe vim.exe") or ((WinActive("ahk_exe cmd.exe") or WinActive("ahk_exe powershell.exe") or WinActive("ahk_exe ConEmu64.exe")) and WinActive("- VIM"))
<^<+Left::
SendInput +{Left}
SendInput +{Right}
SendInput ^{Left}
return
<^<+Right::
SendInput +{Right}
SendInput +{Left}
SendInput ^{Right}
return
#If