There is a line in defaults.vim
that enables Vim Script syntax for any .txt
file with vimrc
in its filename (for example, vimrc-tips.txt
):
au BufNewFile,BufRead *vimrc* call s:StarSetf('vim')
I want to replace *vimrc*
with *vimrc
or maybe even with a regular expression that will allow only the period or underscore as the first character.
For this, if understnad correctly, I need to disable the original autocommand first.
I tried to disable it with
" see https://stackoverflow.com/questions/25829710
augroup standard
autocmd!
autocmd BufNewFile,BufRead *vimrc* setlocal setfiletype disabled
augroup END
The idea is that this should disable treating files like vimrc-tips.txt
as Vim Script files, but at the same time this should not disable syntax for _vimrc
, .vimrc
, or any other files (for example, foo.md
or bar.js
).
But this doesn't disable syntax for files like vimrc-tips.txt
, and even worse when I open such a file, there is a message:
Press ENTER or type command to continue
How this should be fixed?