windows - 不能在 gvim (windows) 中将 CTRL-<Space> 与 Cscope 插件一起使用

标签 windows vim cscope

配置

  • Windows 7 Service Pack 1(64 位)
  • VIM 7.4(2013 年 8 月 10 日),32 位 GUI 版本
  • 来自 www.vim.org 的 cscope_macros.vim 插件,版本 2.0.0

问题

该插件映射了多个 cscope 查找函数,以使用“CTRL-空格键”或 <CTRL-@> 在水平或垂直拆分中打开。 ,因为这是 VIM 根据插件文档识别它的方式。这是插件的一个片段:

" Using 'CTRL-spacebar' (intepreted as CTRL-@ by vim) then a search type
" makes the vim window split horizontally, with search result displayed in
" the new window.
"
" (Note: earlier versions of vim may not have the :scs command, but it
" can be simulated roughly via:
"    nmap <C-@>s <C-W><C-S> :cs find s <C-R>=expand("<cword>")<CR><CR>  

nmap <C-@>s :scs find s <C-R>=expand("<cword>")<CR><CR> 
nmap <C-@>g :scs find g <C-R>=expand("<cword>")<CR><CR> 

但是,“CTRL-空格键”不起作用。当我查看已映射的内容时 <C-@>其实翻译成<nul> .例如,如果我使用命令 :map ,这是 cscope 插件映射键的结果。

n   <nul>d        :scs find d <C-R>=expand("<cword>")<CR><CR><Tab>
n   <nul>i        :scs find i <C-R>=expand("<cfile>")<CR><CR><Tab>
n   <nul>f        :scs find f <C-R>=expand("<cfile>")<CR><CR><Tab>
n   <nul>e        :scs find e <C-R>=expand("<cword>")<CR><CR><Tab>

我唯一能找到的东西 'CTRL-spacebar'/<CTRL-@> ( :help index ) 是

tag     char        action in Insert mode   ~
-----------------------------------------------------------------------
i_CTRL-@    CTRL-@      insert previously inserted text and stop
                        insert

但这不是我观察到的行为。

当我尝试在插入模式下使用“CTRL-空格键”时,所有发生的事情都是在光标处插入了一个空格。当我在正常模式下使用它时,它似乎将光标移动到下一个单词的开头,如果它是空白,则移动到下一行。

那么,如何在 Windows 上的 VIM 中映射“CTRL-空格键”?

最佳答案

在 Windows GVIM 中,使用简单的 <C-Space>作为映射的左侧。 <C-@>或等效的 <Nul>是 (Linux) 终端的解决方法,它通常提供较少的可映射键。这些说明大概只是针对这一点。

关于windows - 不能在 gvim (windows) 中将 CTRL-<Space> 与 Cscope 插件一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26257869/

相关文章:

windows - 使用 Windows 命令提示符 (cmd.exe) 的 StackOverflow 信誉

c++ - 如何在获取事件后延迟 1s 复制文件?

C++ - EncryptMessage 没有加密正确的数据

go - 如何在 Go 终端的一部分中使用 Vim

linux - 无法转到引用线

linux - 使用vim/cscope查找linux内核中的符号定义

windows - 将文件夹内容复制到创建的 .zip 文件 : 'file not found or no read permissions'

vim - 如何在 vim 中映射多个 <leader> 键?

c++ - 我如何使用 vim cindent 实现这一点?

emacs 智能感知