What is the difference between the remap, noremap, nnoremap and vnoremap mapping commands in Vim?
What is the difference between the remap , noremap , nnoremap and vnoremap mapping
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
remapis an option that makes mappings work recursively. By default, it is on and I’d recommend you leave it that way. The rest are mapping commands, described below::mapand:noremapare recursive and non-recursive versions of the various mapping commands. For example, if we run:Then:
jwill be mapped togg.Qwill also be mapped togg, becausejwill be expanded for the recursive mapping.Wwill be mapped toj(and not togg) becausejwill not be expanded for the non-recursive mapping.Now remember that Vim is a modal editor. It has a normal mode, visual mode and other modes.
For each of these sets of mappings, there is a mapping that works in normal, visual, select and operator modes (
:mapand:noremap), one that works in normal mode (:nmapand:nnoremap), one in visual mode (:xmapand:xnoremap) and so on.For more guidance on this, see: