On Wednesday, November 28, 2012 1:22:55 PM UTC-6, Andy Wokula wrote:
>
> There is a way:
>
> :h autocmd-patterns
>
> and a few lines below:
>
> :h file-pattern
>
>
>
> It is allowed to intermix regexp patterns:
>
>
>
> :autocmd BufReadPost *\(.git/COMMIT_EDITMSG\)\@<! <do stuff>
>
>
>
> Hints:
>
> - items starting with `\' are used like in regexp patterns
>
> - the item to match any character is `?', even within `\(...\)'; the
>
> dot `.' matches `.' literally here
>
> - I had to use `\(', because `\%(' gave me an error message
>
> E55: Unmatched \)
>
>
I didn't know you could use regex patterns in autocmds. The only indication I see of this fact is from :help file-patterns:
\ special meaning like in a |pattern|
This certainly doesn't tell me regex in general is supported! I wonder if things other than \%( and . break, and how much of it works by accident.
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment