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?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communitySay 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?
{}
seems to work for just blank filenames.
Example: autocmd myVimrc BufEnter {} echom 'blank filename'
. Much cleaner