New answers tagged

2

The files in the syntax directory should be named after the filetype detected by Vim. In the case of your C++ code, I'd expect it would detect it as cpp. You can check that with the following command: :set filetype? cpp Or you can use :set ft? for short. Once you confirm that the filetype is indeed cpp, you can create file ~/.vim/after/syntax/cpp.vim (for ...


2

Most probably you have set spell enabled which usually checks spelling in comments. If you don't need it turn it off with :set nospell. Activate when you need it with :set spell. To toggle use :set spell!. Map it if you do it often, for example: nnoremap yos :set spell!<CR> Then yos will toggle spelling.


0

I hacked it like this, by switching the keywords to a match rather than keyword definition: syn match json_keyword "true\|false\|null" contained This is okay because the number of keywords is small, and there are no words in JSON that are not keywords. So that is to say, now if we enter, say #Jfalsehood the false part is highlighted as a keyword, ...


1

You can use :execute {expr1} to execute the string that results from the evaluation of {expr1} as an Ex command. execute "syn sync ...".s:funcrgx."..." in place of syn sync ...


3

Is there anything I can do to correct the interpretation of the dollar signs by syntax highlighting? Out of the box, so far as I know: No. However, you can use the special "TeX comment" %stopzone to stop the mathzones. In this particular case, you need multiple comments, so this should work: \begin{table}\centering \begin{tabular}{>{$}l<{$...


Top 50 recent answers are included