From b6d757eee6c140adafee573e73cee9c8bcf7a8e3 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Mon, 25 May 2020 16:07:48 +0200 Subject: [PATCH] vim: Fix syntax highlighting for tex read comments in file for drawbacks --- home/.config/nvim/init.vim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/home/.config/nvim/init.vim b/home/.config/nvim/init.vim index 3db9002..c1e9336 100644 --- a/home/.config/nvim/init.vim +++ b/home/.config/nvim/init.vim @@ -85,6 +85,13 @@ let g:vimtex_quickfix_ignore_filters = [ \'Package hyperref Warning: Token not allowed in a PDF string', \'Package typearea Warning: Bad type area settings!', \] +" When using math environments vim does not know if if it currently is in one +" or outside of one unless it parses the file from the start. Parsing the +" file from the start each time fixes this but leads to a performance drop +" (depending on the number of lines). +" Also, somehow using FileType tex does not work, so this will enable slow +" syntax highlighting everywhere once a *.tex file is opened. +autocmd BufEnter *.tex syntax sync fromstart " Color schemes Plug 'altercation/vim-colors-solarized'