Vim run autocmd on all filetypes EXCEPT

*.rb isn’t a filetype. It’s a file pattern. ruby is the filetype and could even be set on files that don’t have a .rb extension. So, what you most likely want is a function that your autocmd calls to both check for filetypes which shouldn’t be acted on and strips the whitespace. fun! StripTrailingWhitespace() ” … Read more