vim-syntax-highlighting

Vim wrong syntax highlighting in Groovy

南楼画角 提交于 2019-12-23 09:50:28
问题 when I do the single slash ( / ) when typing some arithmetic expression (like val1 / val2 ), my vim treats it as a comment for multiple lines ( /* ). The result looks like: I now I can escape it by typing ;/ at the end of that line (which closes the comment), but it is still annoying and I'd like for my vim to behave properly :). I've tried using another vim syntax highlighting package for groovy, I've tried :filetype plugin off in my .vimrc, I've tried purging vim with my settings and

Define a syntax region which depends on the indentation level

99封情书 提交于 2019-12-21 19:58:14
问题 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 "..

Razor .cshtml syntax highlighting for vim?

梦想与她 提交于 2019-12-21 07:24:09
问题 I'm looking for a .cshtml vim syntax file. Are there any projects that haven't made it to www.vim.org? 回答1: ":setf html" solves the 80% part :) 回答2: 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 回答3: 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 回答4: Settled with adding this to

Syntax highlighting in terminal vim but not gVIM

假装没事ソ 提交于 2019-12-21 05:22:23
问题 I am currently using VIM in the terminal and have perfect syntax highlighting happening. But then when I try to use gvim no matter what type of file or how many times I type: ":syntax on" I don't get any syntax highlighting. Any ideas anyone? Thank you. Here is my .vimrc for those who are interested: " Turn on pathogen for all plug-ins installed after 9/13/2010 call pathogen#helptags() call pathogen#runtime_append_all_bundles() " My color theme for vim colors sorcerer " Disable line wrapping

Javascript syntax highlighting in vim

让人想犯罪 __ 提交于 2019-12-20 08:24:08
问题 Has anyone else found VIM's syntax highlighting of Javascript sub-optimal? I'm finding that sometimes I need to scroll around in order to get the syntax highlighting adjusted, as sometimes it mysteriously drops all highlighting. Are there any work-arounds or ways to fix this? I'm using vim 7.1. 回答1: You might like to try this improved Javascript syntax highlighter rather than the one that ships with VIMRUNTIME. 回答2: Well, I've modified Yi Zhao's Javascript Syntax, and added Ajax Keywords

Vim variable syntax highlighting

∥☆過路亽.° 提交于 2019-12-18 19:21:30
问题 I'd like to change my vim config file to allow highlighting of only my declared variables, not keywords. This article shows and explains what I mean: Alternate syntax highlighting I'm a beginner to vim (I've never changed the default config file). Could anyone point me in the right direction? 回答1: As proof of concept, I tried let vars = ['init', 'editable', 'init_ui'] let colors = ['ff0000', '00ff00', '0000ff'] for var in vars execute 'syn keyword var_' . var var execute 'hi default var_' .

Vim variable syntax highlighting

可紊 提交于 2019-12-18 19:21:30
问题 I'd like to change my vim config file to allow highlighting of only my declared variables, not keywords. This article shows and explains what I mean: Alternate syntax highlighting I'm a beginner to vim (I've never changed the default config file). Could anyone point me in the right direction? 回答1: As proof of concept, I tried let vars = ['init', 'editable', 'init_ui'] let colors = ['ff0000', '00ff00', '0000ff'] for var in vars execute 'syn keyword var_' . var var execute 'hi default var_' .

Add GoLang syntax highlighting for VIM

青春壹個敷衍的年華 提交于 2019-12-18 10:14:27
问题 I'm trying to add Go language syntax highlighting to VIM on ubuntu with resources and direction supplied here http://go-lang.cat-v.org/text-editors/vim/. Go comes with a go.vim file that contains syntax settings for VIM and the above page offers the following instructions Place $GOROOT/misc/vim/syntax/go.vim in ~/.vim/syntax/ and put the following in ~/.vim/ftdetect/go.vim: au BufRead,BufNewFile *.go set filetype=go This is more or less the same vein of procedure for customizing vim syntax I

Embedded syntax highligting in Vim

夙愿已清 提交于 2019-12-17 15:31:25
问题 I have a custom XML file format which can contain blocks of code within certain tags. For example: <Root> <Sql> select * from foo </Sql> <MoreJunk> ... </MoreJunk> <Python><![CDATA[ def Bar(*args): return False ]]></Python> </Root> How can I get Vim to use SQL syntax highlighting for the text inside <Sql> tags and use Python higlighting for text inside <Python> tags? I know Vim can already do this because it correctly highlights Javascript inside HTML files. I tried inspecting the HTML syntax

Highlight SQL inside Python string literals

有些话、适合烂在心里 提交于 2019-12-12 16:14:24
问题 I have some Python files in which I want to highlight the SQL queries in string literals. Assume that all string literals in those files contain SQL queries. I saved the following syntax file as pysql.vim: if exists("b:current_syntax") finish endif " Include Python syntax runtime! syntax/python.vim unlet b:current_syntax syn include @SQL syntax/sql.vim syn region SQLEmbedded start=+'+ end=+'+ contains=@SQL syn region SQLEmbedded start=+%+ end=+%+ contains=@SQL let b:current_syntax = "pysql" I