comparison runtime/doc/map.txt @ 25463:05f9e8f2016c v8.2.3268

patch 8.2.3268: cannot use a block with :autocmd like with :command Commit: https://github.com/vim/vim/commit/73b8b0ae3acac220e823076f8ca1c14524ed96dd Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 1 14:52:32 2021 +0200 patch 8.2.3268: cannot use a block with :autocmd like with :command Problem: Cannot use a block with :autocmd like with :command. Solution: Add support for a {} block after :autocmd. (closes https://github.com/vim/vim/issues/8620)
author Bram Moolenaar <Bram@vim.org>
date Sun, 01 Aug 2021 15:00:05 +0200
parents bdda48f01a68
children 2063b858cad9
comparison
equal deleted inserted replaced
25462:66d8f0116a76 25463:05f9e8f2016c
1 *map.txt* For Vim version 8.2. Last change: 2021 Jul 28 1 *map.txt* For Vim version 8.2. Last change: 2021 Aug 01
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
1569 Note that these arguments can be abbreviated, but that is a deprecated 1569 Note that these arguments can be abbreviated, but that is a deprecated
1570 feature. Use the full name for new scripts. 1570 feature. Use the full name for new scripts.
1571 1571
1572 1572
1573 Replacement text ~ 1573 Replacement text ~
1574 1574 *:command-repl*
1575 The {repl} argument is normally one long string, possibly with "|" separated 1575 The {repl} argument is normally one long string, possibly with "|" separated
1576 commands. A special case is when the argument is "{", then the following 1576 commands. A special case is when the argument is "{", then the following
1577 lines, up to a line starting with "}" are used and |Vim9| syntax applies. 1577 lines, up to a line starting with "}" are used and |Vim9| syntax applies.
1578 Example: > 1578 Example: >
1579 :command MyCommand { 1579 :command MyCommand {
1580 echo 'hello' 1580 echo 'hello'
1581 g:calledMyCommand = true 1581 g:calledMyCommand = true
1582 } 1582 }
1583 No nesting is supported. Using `:normal` directly does not work, you can use 1583 No nesting is supported, inline functions cannot be used. Using `:normal`
1584 it indirectly with `:execute`. 1584 directly does not work, you can use it indirectly with `:execute`.
1585 1585
1586 The replacement text {repl} for a user defined command is scanned for special 1586 The replacement text {repl} for a user defined command is scanned for special
1587 escape sequences, using <...> notation. Escape sequences are replaced with 1587 escape sequences, using <...> notation. Escape sequences are replaced with
1588 values from the entered command line, and all other text is copied unchanged. 1588 values from the entered command line, and all other text is copied unchanged.
1589 The resulting string is executed as an Ex command. To avoid the replacement 1589 The resulting string is executed as an Ex command. To avoid the replacement