Hitting enter in the quickfix window doesn't work

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!


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>