简体   繁体   中英

what is the meaning of \ | in a map vim command?

Here is a map command.

nnoremap <F5> :w\|!R %<CR>

1.what is the meaning of \\ here?
2. does | mean pipe ?

The | character separates two Ex commands, see :help :| . It's like ; in programming languages like C and Java. It has nothing to do with pipes; Vim hasn't that concept (which is typically found in shells).

It is escaped here so that the entire command sequence belongs to the mapping; ie it maps to :w|!R %<CR> . Without escaping, Vim would execute the following instead:

:nnoremap <F5> :w
:!R %<CR>

Note that you can also write <Bar> (cp. :help key-notation ) instead of \\| , and the former is more frequently used.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM