通常,在 qucikfix 窗口中按 Enter 会跳转到相应的行。但是当我按回车键时,状态行中有一条消息,说“xxx 匹配,xx 行”,而不是跳转。似乎回车键被映射到奇怪的键。
当我用鼠标双击时,它正常跳跃。它表明该行的格式是正确的。顺便说一下,quickfix 窗口是通过 vimgrep 命令打开的。
我怎样才能找到问题所在?
谢谢!
Ing*_*kat 17
您可能有一个全局映射<CR>
,不幸的是它也覆盖了 quickfix 窗口中的特殊行为。您可以通过将以下 autocmd 放入您的~/.vimrc
:
" In the quickfix window, <CR> is used to jump to the error under the
" cursor, so undefine the mapping there.
autocmd BufReadPost quickfix nnoremap <buffer> <CR> <CR>
Run Code Online (Sandbox Code Playgroud)