aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/autocmd.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/autocmd.txt')
-rw-r--r--runtime/doc/autocmd.txt16
1 files changed, 8 insertions, 8 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index e922d5b601..7b53bd64ca 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -28,7 +28,7 @@ a file, when entering or leaving a buffer or window, and when exiting Vim.
For example, you can create an autocommand to set the 'cindent' option for
files matching *.c. You can also use autocommands to implement advanced
features, such as editing compressed files (see |gzip-example|). The usual
-place to put autocommands is in your .vimrc or .exrc file.
+place to put autocommands is in your vimrc file.
*E203* *E204* *E143* *E855*
WARNING: Using autocommands is very powerful, and may lead to unexpected side
@@ -73,8 +73,8 @@ exception is that "<sfile>" is expanded when the autocmd is defined. Example:
Here Vim expands <sfile> to the name of the file containing this line.
-When your .vimrc file is sourced twice, the autocommands will appear twice.
-To avoid this, put this command in your .vimrc file, before defining
+When your vimrc file is sourced twice, the autocommands will appear twice.
+To avoid this, put this command in your vimrc file, before defining
autocommands: >
:autocmd! " Remove ALL autocommands for the current group.
@@ -695,7 +695,7 @@ FuncUndefined When a user function is used but it isn't
GUIEnter After starting the GUI successfully, and after
opening the window. It is triggered before
VimEnter when using gvim. Can be used to
- position the window from a .gvimrc file: >
+ position the window from a gvimrc file: >
:autocmd GUIEnter * winpos 100 50
< *GUIFailed*
GUIFailed After starting the GUI failed. Vim may
@@ -907,7 +907,7 @@ UserGettingBored When the user presses the same key 42 times.
Just kidding! :-)
*VimEnter*
VimEnter After doing all the startup stuff, including
- loading .vimrc files, executing the "-c cmd"
+ loading vimrc files, executing the "-c cmd"
arguments, creating all windows and loading
the buffers in them.
*VimLeave*
@@ -994,7 +994,7 @@ expect.
Environment variables can be used in a pattern: >
:autocmd BufRead $VIMRUNTIME/doc/*.txt set expandtab
And ~ can be used for the home directory (if $HOME is defined): >
- :autocmd BufWritePost ~/.vimrc so ~/.vimrc
+ :autocmd BufWritePost ~/.config/nvim/init.vim so <afile>
:autocmd BufRead ~archive/* set readonly
The environment variable is expanded when the autocommand is defined, not when
the autocommand is executed. This is different from the command!
@@ -1135,7 +1135,7 @@ Example: >
:augroup END
This prevents having the autocommands defined twice (e.g., after sourcing the
-.vimrc file again).
+vimrc file again).
==============================================================================
9. Executing autocommands *autocmd-execute*
@@ -1157,7 +1157,7 @@ option will not cause any commands to be executed.
It's possible to use this inside an autocommand too,
so you can base the autocommands for one extension on
another extension. Example: >
- :au BufEnter *.cpp so ~/.vimrc_cpp
+ :au BufEnter *.cpp so ~/.config/nvim/init_cpp.vim
:au BufEnter *.cpp doau BufEnter x.c
< Be careful to avoid endless loops. See
|autocmd-nested|.