I want to run a command in the .vimrc in case a file is a latex file. I think I have something with the syntax, it does not work. Any clue?
if &filetype=='tex'     set spell endif 
                You can use auto commands to achieve what you want:
autocmd BufNewFile,BufRead *.tex set spell 
                        For those who want to check the current filetype and do something while editing, this should work:
if (&ft=='c' || &ft=='cpp')     :!g++ % endif 
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With