2

Say I want to match a buffer with no filename.

I can use the pattern *, then manually check the filename, like autocmd myVimrc BufEnter * if @% == "" | echom 'blank filename' | endif

Is there a pattern to match just blank filenames?

1

{} seems to work for just blank filenames.

Example: autocmd myVimrc BufEnter {} echom 'blank filename'. Much cleaner

|improve this answer|||||

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.