If I have this vimrc:

set nocompatible
nnoremap <C-m> ^^

When I try to open a file from the quickfix window by pressing enter nothing happens.

If I comment out the last line, so the vimrc is this:

set nocompatible
" nnoremap <C-m> ^^

Then the quickfix window works as expected.

Note that those two lines are the entire vimrc file. No plugins are being loaded either.

I've had the above mapping in my vimrc for over a decade and have always had strange issues with the quickfix window. I finally figured out what's causing it but I'm still stumped, what's going on here?

  • 2
    Not directly but it did lead me to the solution. I'll add an answer to this question.
    – Alligator
    Commented Jan 1, 2020 at 13:12
  • Related question: Separate C-m and Enter
    – Hotschke
    Commented Jan 9, 2020 at 7:47

1 Answer 1


I figured this out, and decided to just remove the mapping.

It's happening because (at least in my environment, using vim in a terminal over SSH) there's no distinction between <C-m> and <CR>, they're one and the same to vim. If I remap <C-m> in normal mode, I'm also remapping <CR> in normal mode. I don't tend to press enter in normal mode so I didn't notice, except in the quickfix window.

I could modify the mapping to not apply in the quickfix window as suggested in the comments, but in this case I just removed the mapping, as it seems like an all around bad idea.

  • 1
    <C-m> is always the same as <CR> in terminals. I wrote a more in-depth explainer some time ago at bestasciitable.com Commented Jan 3, 2020 at 8:27

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