-*autocmd.txt* For Vim version 9.1. Last change: 2025 Sep 02
+*autocmd.txt* For Vim version 9.1. Last change: 2025 Sep 11
VIM REFERENCE MANUAL by Bram Moolenaar
Note that for all systems the '/' character is used for path separator (even
for MS-Windows). This was done because the backslash is difficult to use in a
-pattern and to make the autocommands portable across different systems.
+pattern and to make the autocommands portable across different systems. To
+only match a '/' on all platforms (e.g. in a non-file pattern), use "\/".
It is possible to use |pattern| items, but they may not work as expected,
because of the translation done for the above.
autocmd. Example: >
augroup vimrc-incsearch-highlight
autocmd!
- autocmd CmdlineEnter /,\? :set hlsearch
- autocmd CmdlineLeave /,\? :set nohlsearch
+ autocmd CmdlineEnter [\/\?] :set hlsearch
+ autocmd CmdlineLeave [\/\?] :set nohlsearch
augroup END
<
CTRL-L can be used to add one character from after the current match