Mercurial > vim
comparison runtime/doc/usr_40.txt @ 29269:0fdf36de4018
Update runtime files
Commit: https://github.com/vim/vim/commit/8cc5b559f70041361612b8a6a87922503b33baa6
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jun 23 13:04:20 2022 +0100
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 23 Jun 2022 14:15:04 +0200 |
parents | 3e661b0cf500 |
children | d314efe6447a |
comparison
equal
deleted
inserted
replaced
29268:4b53fd331519 | 29269:0fdf36de4018 |
---|---|
1 *usr_40.txt* For Vim version 8.2. Last change: 2022 Jan 03 | 1 *usr_40.txt* For Vim version 8.2. Last change: 2022 Jun 20 |
2 | 2 |
3 VIM USER MANUAL - by Bram Moolenaar | 3 VIM USER MANUAL - by Bram Moolenaar |
4 | 4 |
5 Make new commands | 5 Make new commands |
6 | 6 |
461 {file-pattern} is a filename, usually with wildcards. For example, using | 461 {file-pattern} is a filename, usually with wildcards. For example, using |
462 "*.txt" makes the autocommand be used for all files whose name end in ".txt". | 462 "*.txt" makes the autocommand be used for all files whose name end in ".txt". |
463 The optional [++nested] flag allows for nesting of autocommands (see below), | 463 The optional [++nested] flag allows for nesting of autocommands (see below), |
464 and finally, {command} is the command to be executed. | 464 and finally, {command} is the command to be executed. |
465 | 465 |
466 When adding an autocommand the already existing ones remain. To avoid adding | |
467 the autocommand several time you should use this form: > | |
468 | |
469 :augroup updateDate | |
470 : autocmd! | |
471 : autocmd BufWritePre * call DateInsert() | |
472 :augroup END | |
473 | |
474 This will delete any previously defined autocommand with `:autocmd!` before | |
475 defining the new one. Groups are explained later. | |
476 | |
466 | 477 |
467 EVENTS | 478 EVENTS |
468 | 479 |
469 One of the most useful events is BufReadPost. It is triggered after a new | 480 One of the most useful events is BufReadPost. It is triggered after a new |
470 file is being edited. It is commonly used to set option values. For example, | 481 file is being edited. It is commonly used to set option values. For example, |