if filetype == tex June 6, 2023 by Tarik You can use auto commands to achieve what you want: autocmd BufNewFile,BufRead *.tex set spell