How does the following regex (or is it a regex?) work:

au BufWinEnter,BufRead  ?*  loadview

I believe that ?* makes sure that the filepath has at least one character, but why isn't this then just .. What is the format of the 'filetype-match regex' ? For example, to match all .txt files why isn't the pattern:

And instead it is *.txt ?

enter image description here

  • 2
    See :help file-pattern, and perhaps read the whole :help autocmd-patterns section in the help of autocmd... This pattern is not really a regexp-style pattern, it's a different syntax, more akin shell wildcards. – filbranden Jun 27 at 4:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.