aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/api.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/api.txt')
-rw-r--r--runtime/doc/api.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index b949f3016e..8928650a39 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -3267,6 +3267,12 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()*
pattern = { "*.py", "*.pyi" }
<
+ Note: The `pattern` is passed to callbacks and commands as a literal string; environment
+ variables like `$HOME` and `~` are not automatically expanded as they are by |:autocmd|. Instead,
+ |expand()| such variables explicitly: >
+ pattern = vim.fn.expand("~") .. "/some/path/*.py"
+<
+
Example values for event: >
"BufWritePre"
{"CursorHold", "BufWritePre", "BufWritePost"}
@@ -3279,7 +3285,7 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()*
• group (string|integer) optional: the autocommand group name
or id to match against.
• pattern (string|array) optional: pattern or patterns to
- match against |autocmd-pattern|.
+ match literally against |autocmd-pattern|.
• buffer (integer) optional: buffer number for buffer local
autocommands |autocmd-buflocal|. Cannot be used with
{pattern}.