comparison runtime/doc/map.txt @ 7597:3012eaddb6b2

commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 15 20:57:49 2016 +0100 Update runtime files
author Christian Brabandt <cb@256bit.org>
date Fri, 15 Jan 2016 21:00:07 +0100
parents 0550be8fc7f6
children 0bdeaf7092bc
comparison
equal deleted inserted replaced
7596:a9234d9e3efd 7597:3012eaddb6b2
1 *map.txt* For Vim version 7.4. Last change: 2014 Dec 08 1 *map.txt* For Vim version 7.4. Last change: 2016 Jan 10
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
481 written to the script file. If it was recognized as a terminal code the 481 written to the script file. If it was recognized as a terminal code the
482 internal code is written to the script file. 482 internal code is written to the script file.
483 483
484 484
485 1.6 SPECIAL CHARACTERS *:map-special-chars* 485 1.6 SPECIAL CHARACTERS *:map-special-chars*
486 *map_backslash* 486 *map_backslash* *map-backslash*
487 Note that only CTRL-V is mentioned here as a special character for mappings 487 Note that only CTRL-V is mentioned here as a special character for mappings
488 and abbreviations. When 'cpoptions' does not contain 'B', a backslash can 488 and abbreviations. When 'cpoptions' does not contain 'B', a backslash can
489 also be used like CTRL-V. The <> notation can be fully used then |<>|. But 489 also be used like CTRL-V. The <> notation can be fully used then |<>|. But
490 you cannot use "<C-V>" like CTRL-V to escape the special meaning of what 490 you cannot use "<C-V>" like CTRL-V to escape the special meaning of what
491 follows. 491 follows.
492 492
493 To map a backslash, or use a backslash literally in the {rhs}, the special 493 To map a backslash, or use a backslash literally in the {rhs}, the special
494 sequence "<Bslash>" can be used. This avoids the need to double backslashes 494 sequence "<Bslash>" can be used. This avoids the need to double backslashes
495 when using nested mappings. 495 when using nested mappings.
496 496
497 *map_CTRL-C* 497 *map_CTRL-C* *map-CTRL-C*
498 Using CTRL-C in the {lhs} is possible, but it will only work when Vim is 498 Using CTRL-C in the {lhs} is possible, but it will only work when Vim is
499 waiting for a key, not when Vim is busy with something. When Vim is busy 499 waiting for a key, not when Vim is busy with something. When Vim is busy
500 CTRL-C interrupts/breaks the command. 500 CTRL-C interrupts/breaks the command.
501 When using the GUI version on MS-Windows CTRL-C can be mapped to allow a Copy 501 When using the GUI version on MS-Windows CTRL-C can be mapped to allow a Copy
502 command to the clipboard. Use CTRL-Break to interrupt Vim. 502 command to the clipboard. Use CTRL-Break to interrupt Vim.
503 503
504 *map_space_in_lhs* 504 *map_space_in_lhs* *map-space_in_lhs*
505 To include a space in {lhs} precede it with a CTRL-V (type two CTRL-Vs for 505 To include a space in {lhs} precede it with a CTRL-V (type two CTRL-Vs for
506 each space). 506 each space).
507 *map_space_in_rhs* 507 *map_space_in_rhs* *map-space_in_rhs*
508 If you want a {rhs} that starts with a space, use "<Space>". To be fully Vi 508 If you want a {rhs} that starts with a space, use "<Space>". To be fully Vi
509 compatible (but unreadable) don't use the |<>| notation, precede {rhs} with a 509 compatible (but unreadable) don't use the |<>| notation, precede {rhs} with a
510 single CTRL-V (you have to type CTRL-V two times). 510 single CTRL-V (you have to type CTRL-V two times).
511 *map_empty_rhs* 511 *map_empty_rhs* *map-empty-rhs*
512 You can create an empty {rhs} by typing nothing after a single CTRL-V (you 512 You can create an empty {rhs} by typing nothing after a single CTRL-V (you
513 have to type CTRL-V two times). Unfortunately, you cannot do this in a vimrc 513 have to type CTRL-V two times). Unfortunately, you cannot do this in a vimrc
514 file. 514 file.
515 *<Nop>* 515 *<Nop>*
516 An easier way to get a mapping that doesn't produce anything, is to use 516 An easier way to get a mapping that doesn't produce anything, is to use
581 581
582 *map-comments* 582 *map-comments*
583 It is not possible to put a comment after these commands, because the '"' 583 It is not possible to put a comment after these commands, because the '"'
584 character is considered to be part of the {lhs} or {rhs}. 584 character is considered to be part of the {lhs} or {rhs}.
585 585
586 *map_bar* 586 *map_bar* *map-bar*
587 Since the '|' character is used to separate a map command from the next 587 Since the '|' character is used to separate a map command from the next
588 command, you will have to do something special to include a '|' in {rhs}. 588 command, you will have to do something special to include a '|' in {rhs}.
589 There are three methods: 589 There are three methods:
590 use works when example ~ 590 use works when example ~
591 <Bar> '<' is not in 'cpoptions' :map _l :!ls <Bar> more^M 591 <Bar> '<' is not in 'cpoptions' :map _l :!ls <Bar> more^M
599 599
600 When 'b' is present in 'cpoptions', "\|" will be recognized as a mapping 600 When 'b' is present in 'cpoptions', "\|" will be recognized as a mapping
601 ending in a '\' and then another command. This is Vi compatible, but 601 ending in a '\' and then another command. This is Vi compatible, but
602 illogical when compared to other commands. 602 illogical when compared to other commands.
603 603
604 *map_return* 604 *map_return* *map-return*
605 When you have a mapping that contains an Ex command, you need to put a line 605 When you have a mapping that contains an Ex command, you need to put a line
606 terminator after it to have it executed. The use of <CR> is recommended for 606 terminator after it to have it executed. The use of <CR> is recommended for
607 this (see |<>|). Example: > 607 this (see |<>|). Example: >
608 :map _ls :!ls -l %:S<CR>:echo "the end"<CR> 608 :map _ls :!ls -l %:S<CR>:echo "the end"<CR>
609 609