Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

vim

mapping

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

like image 783
Lucia Avatar asked Mar 03 '14 09:03

Lucia


People also ask

What does CR mean command?

The CR command collects failure information and either displays it on the console or dumps the information to a floppy disk.

What key is CR?

Short for carriage return, CR is often used to represent a carriage return done by pressing the Enter and Return key.

What does C mean vim?

In Vim (and Emacs) documentation, C- and M- stand for Ctrl and Meta (i.e. Alt ) respectively.


1 Answers

: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.

like image 79
romainl Avatar answered Oct 19 '22 04:10

romainl