6

Normally, hitting enter in the qucikfix window leads to jump to the corresponding line. But when I hit enter, there is a message in the status line, says "xxx matchs, xx lines", instead of jumping. It seems that the enter key is mapped to strange key.

When I double click with mouse, it jumps normally. It suggests that the format of the line is correct. By the way, the quickfix window is opened by the command of vimgrep.

How can I find where the problem is?

Thanks!

14

You probably have a global mapping for <CR>, which unfortunately also overrides the special behavior in the quickfix window. You can correct that by putting the following autocmd into your ~/.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>
  • cool, it works! Is there a command that check what <cr> maps to. – Sisyphus Sep 23 '14 at 9:08
  • 5
    Yes, :verbose nmap <CR> should tell you where it got defined, and to what it maps to. – Ingo Karkat Sep 23 '14 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.