vim-syntax-highlighting

Syntax highlighting randomly disappears during file saving

╄→尐↘猪︶ㄣ 提交于 2019-12-10 03:45:19
问题 I'm using vim to edit some python files and recently it occurs sporadically that the syntax highlighting disappears after I save the buffer inside vim. I tried to reset syntax on and set filetype=python but to no avail. I have no clue of what causes this problem at all, so right now I have minimal diagnostic info. But has anyone encountered this before, or where could things break down? 回答1: This is not a solution, but it's hard to write/read in the comments. I meant that I was messing around

Turn off highlighting a certain pattern in vim

一世执手 提交于 2019-12-07 04:15:55
问题 In vim, I am editing a file of filetype "markdown", but which contains latex math expressions such as $x_i$. Vim's syntax highlighting for markdown thinks the pattern *_* (letter-underscore-letter) is an error, and highlights the underscore in such patterns bright red. I would like to turn this off by adding a line to my .vimrc: autocmd BufEnter *.Rmd "Dear vim, please don't highlight the pattern *_*" What is the appropriate command to do that? Is it possible at all to do that in .vimrc,

Set item to higher highlight priority on vim

a 夏天 提交于 2019-12-07 02:27:14
问题 I want to non ascii characters to show as discussed here, but the syntax highlight disappears when the non ascii character are inside a comment. Investigating a little the problem, I've discovered at the vim-manual that an item that starts earlier has higher priority (3rd item). From help :syn-priority : When several syntax items may match, these rules are used: When multiple Match or Region items start in the same position, the item defined last has priority. A Keyword has priority over

Turn off highlighting a certain pattern in vim

吃可爱长大的小学妹 提交于 2019-12-05 10:45:47
In vim, I am editing a file of filetype "markdown", but which contains latex math expressions such as $x_i$. Vim's syntax highlighting for markdown thinks the pattern *_* (letter-underscore-letter) is an error, and highlights the underscore in such patterns bright red. I would like to turn this off by adding a line to my .vimrc: autocmd BufEnter *.Rmd "Dear vim, please don't highlight the pattern *_*" What is the appropriate command to do that? Is it possible at all to do that in .vimrc, without editing a syntax file? Note: I want to keep the markdown syntax highlighting in general, only turn

Vim syntax and Latex math inside markdown

我怕爱的太早我们不能终老 提交于 2019-12-05 05:29:52
I write documentation in markdown using ViM and I also put math using the latex $$ symbol (I compile using pandoc). The thing is that ViM syntax wouldn't ignore the underscores _ inside the dollar symbols and it is pretty annoying. For instance if I write this: $$ a_1 = 0 $$ Then Vim will highlight all the following text as italics due to to the underscore used. How can I change that? Also it would be nice if I could highlight what's inside $ with a different format. I have put these lines in my .vimrc. It works for inline math on the same line and block-mode math. " This gets rid of the nasty

Set item to higher highlight priority on vim

自闭症网瘾萝莉.ら 提交于 2019-12-05 04:22:19
I want to non ascii characters to show as discussed here , but the syntax highlight disappears when the non ascii character are inside a comment. Investigating a little the problem, I've discovered at the vim-manual that an item that starts earlier has higher priority (3rd item). From help :syn-priority : When several syntax items may match, these rules are used: When multiple Match or Region items start in the same position, the item defined last has priority. A Keyword has priority over Match and Region items. An item that starts in an earlier position has priority over items that start in

Define a syntax region which depends on the indentation level

﹥>﹥吖頭↗ 提交于 2019-12-04 13:00:26
I'm trying to built a lighter syntax file for reStructuredText in Vim. In rst, literal blocks start when "::" is encountered at the end of a line: I'll show you some code:: if foo = bar then do_something() end Literal blocks end when indentation level is lowered. But, literal blocks can be inside other structures that are indented but not literal: .. important:: Some code for you inside this ".. important" directive:: Code comes here Back to normal text, but it is indented with respect to ".. important". So, the problem is: how to make a region that detects the indentation? I did that with the

Syntax highlight for Sass is not working in Vim

淺唱寂寞╮ 提交于 2019-12-04 12:16:37
I just downloaded a Vim plugin for Sass syntax highlight. The instructions say: install details put it into syntax directory and add sass filetype au! BufRead,BufNewFile *.sass setfiletype sass in your filetype.vim I already placed sass.vim in vimfiles/syntax/ (using windows). And created a filetype.vim file with the code above ( au! Buf... ) in all the following directories: vimfiles/ vimfiles/ftdetect vimfiles/ftplugins but no one worked (I even typed the au! Buf... code in my vimrc). My .sass files still looking like this: alt text http://img193.imageshack.us/img193/4791/sassi.png any

Razor .cshtml syntax highlighting for vim?

本小妞迷上赌 提交于 2019-12-04 00:49:25
I'm looking for a .cshtml vim syntax file. Are there any projects that haven't made it to www.vim.org? ":setf html" solves the 80% part :) this guy has razor support planned, but is not yet there. However, it does add some features to the existing c# support. https://github.com/OrangeT/vim-csharp You can find nice vim-razor plugin in https://github.com/adamclerk/vim-razor $ cd ~/.vim/bundle $ git clone https://github.com/adamclerk/vim-razor Settled with adding this to .vimrc " add html syntax to dotnet razor files autocmd BufNewFile,BufRead *.cshtml set syntax=html Russ Martinez (or maybe

Vim syntax highlighting for ruby 1.9

谁说我不能喝 提交于 2019-12-03 16:51:47
问题 Ruby 1.9 has a few new syntax elements, such as the {key: value} hash literal syntax. Has anyone written or seen an updated syntax/ruby.vim highlighting file that will highlight key: just like it highlights :key in {:key => value} ? 回答1: Try the latest version from github: http://github.com/vim-ruby/vim-ruby/blob/master/syntax/ruby.vim It was updated in December of 2009, and seems to do the right thing with the new hash literals. 回答2: Thoughtbot's dot files might be another good place to