TL;DR: How do I permanently and persistently :set syntax=context
for *.tex
files?
I've been using vim
for a LaTeX project, with monokai-tasty as the colour scheme.
The default syntax highlighting seems to be TeX Highlighting
:set syntax=tex
I personally prefer ConTeXt Highlighting
:set syntax=context
but cannot figure out how to make it stick for all *.tex
buffers, or between sessions.
I've tried several ways of getting this to work, mostly through vimrc
, though none of them have. Most recently I created ~/.vim/ftdetect/tex.vim
containing
autocmd BufNewFile,BufRead *.tex set syntax=context
My vimrc
can be seen here, in case there are any obvious collisions with what I'm trying to do there.
Not sure if I've given enough information. I am, of course, happy to add any more if it's not enough to be helpful.