I want to to run run an autocmd for all but tex files, i figured out this solution:
autocmd BufWritePre *.[^t][^e][^x] :Autoformat
but is kind of ugly, because of this repeated [^..] pattern. Is there a nicer wy?
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 community
The usual way to do this is to call a function for each file and in the function check, return if the file extension is of a certain type. I have explained similar alternativeshere
The disadvantage of your example is, your pattern won't trigger for files like foobar.txt (first t will be excluded), files without extensions, foobar.diff (extension too long).