Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between the `noremap` and `nnoremap` command in vim?

Tags:

vim

I'm editing my vimrc and I want to map some keys to <F-1..12>.

However I found some commands, like noremap and nnoremap. And they can work so good.


But I don't know what is the difference between the noremap and nnoremap.

I found this quesion, but I still don't understand the difference.

like image 547
Remi Crystal Avatar asked Dec 19 '22 00:12

Remi Crystal


1 Answers

nnoremap and noremap are both "no re(cursive) map", the difference is one with n the other not. that is n nore map and nore map, in another word, you are asking the difference between nmap and map

The nnoremap/nmap will work only in Normal mode, but the noremap/map will work in Normal, Visual, Select and Operator-pending modes.

For more information, please read the help doc: :h map-modes There are two tables, which give nice overview of the relation between map commands and modes.

like image 100
Kent Avatar answered May 21 '23 06:05

Kent