What is the meaning of a <CR> at the end of some vim mappings?

Lucia picture Lucia · Mar 3, 2014 · Viewed 31.8k times · Source

I see <cr>s a lot in vim mappings, but what does it do?

Answer

romainl picture romainl · Mar 3, 2014
:help key-notation

says:

notation    meaning            equivalent  decimal    value(s)
-----------------------------------------------------------------------
<CR>        carriage return        CTRL-M    13       *carriage-return*
<Return>    same as <CR>                              *<Return>*
<Enter>     same as <CR>                              *<Enter>*

Mappings often involve Ex commands and you must press <CR> to execute them so it's included in the mapping.