All Questions
Tagged with vim vim-syntax-highlighting
372
questions
142
votes
7
answers
93k
views
Enable Vim Syntax Highlighting By Default
I know how to turn syntax highlighting on and off in vim by running this in the editor:
:syntax on/off
But I want syntax highlighting to be enabled by default, so I don't have to turn it on every ...
116
votes
4
answers
139k
views
Syntax highlighting in vim for python
How do I do I set the syntax highlighting in Vim 7 for python?
I would like to set my own colorschemes, and syntax highlighting for a type of code file.
92
votes
13
answers
85k
views
How to highlight Bash scripts in Vim?
My Vim editor auto highlights PHP files (vim file.php), HTML files (vim file.html) and so on.
But when I type: vim file and inside it write a Bash script, it doesn't highlight it.
How can I tell Vim ...
77
votes
11
answers
66k
views
class & function names highlighting in Vim
I just recently set up my Vim environment from Textmate, after becoming addicted to its modal input.
However, syntax highlighting seems to be not so beautiful in Vim. I code in C++ and since the ...
65
votes
11
answers
79k
views
Add GoLang syntax highlighting for VIM
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 ...
57
votes
9
answers
96k
views
Vim Syntax Highlighting does not work
I've installed a fresh Arch Linux system on my laptop and downloaded the vim package.
I haven't altered the .vimrc file, but the syntax highlighting doesn't seem to work with any of the languages I ...
51
votes
5
answers
47k
views
Javascript syntax highlighting in vim
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 ...
41
votes
4
answers
31k
views
TypeScript syntax highlighting in vim
I installed the typescript plugin via
git clone https://github.com/leafgarland/typescript-vim.git ~/.vim/bundle/typescript-vim
and inserted
au BufRead,BufNewFile *.ts setfiletype typescript
...
36
votes
4
answers
55k
views
assembly vim syntax highlighting
The default assembly syntax file didn't work well and searching the web about gas assembly I found nothing about a gas (AT&T) syntax file for vim. Has anyone found this? I can't write my own ...
34
votes
8
answers
6k
views
Vim syntax highlighting with $ and lstlisting's lstinline
If I use the inline version of lstlisting as shown:
\lstinline{!$omp parallel for}
the syntax highlighting in vim goes wrong, and the remainder of the latex file is coloured red as if it is all part ...
32
votes
4
answers
12k
views
Vim inconsistently syntax highlighting bash files
When I open some bash script files with vim it sometimes identifies them as conf files, that's okay, I can just correct that by setting the filetype to sh with :setf sh.
That great, except I've ...
31
votes
2
answers
21k
views
How to set a custom color to folded highlighting in .vimrc (for use with putty)
Adding the following to .vimrc works
:hi Folded ctermbg=Grey
but it's still too bright and prominent, so we want to specify a more specific color triplet instead, like so:
:hi Folded ctermbg=#...
27
votes
2
answers
8k
views
Turn off highlighting a certain pattern in vim
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 ...
20
votes
5
answers
4k
views
How to avoid syntax-highlighting for large files in vim?
Huge files take forever to load and work with in vim, due to syntax-highlighting.
I'm looking for a way to limit size of highlighted files, such that files larger than (say) 10MB will be colorless.
20
votes
2
answers
5k
views
How to syntax highlight fragments of code in one language embedded in the source code in another language in Vim?
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>...
19
votes
5
answers
5k
views
Razor .cshtml syntax highlighting for vim?
I'm looking for a .cshtml vim syntax file. Are there any projects that haven't made it to www.vim.org?
19
votes
1
answer
6k
views
Vim syntax and Latex math inside markdown
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 ...
18
votes
3
answers
8k
views
Making vim show a git diff with colors like a git diff command (red-delete, green-add)
I ran git config --global alias.ci commit --verbose
This makes it so running git ci is like running git commit --verbose
The --verbose flag shows a diff in the commit message template, which is not ...
17
votes
3
answers
5k
views
Highlight python docstrings as comments (vim syntax highlighting)
Is it possible to modify python.vim (and the corresponding colorscheme file) such that triple-quoted strings right under class and def statements (a.k.a. docstrings) will be highlighted as comments ...
15
votes
4
answers
6k
views
How to enable syntax highlighting for CUDA .cu and .cuh files in Vim?
I found that my ~/.vimrc file has syntax on but it didn't work for any CUDA file (.cu).
Not sure to how to do it.
15
votes
2
answers
9k
views
Syntax coloring with Vim and Fish-Shell
What is the best editor for fish scripts? I mean an editor which can properly highlight, indent and syntax check.
I found the vim-fish project, but I am still scratching my head as to how to install ...
15
votes
2
answers
3k
views
Is Vim's Haskell syntax highlighting broken?
It seems to me that Vim's syntax highlighting for Haskell is broken, or very buggy. Multiline comments in Haskell (beginning with {- and ending with -}) are arbitrarily greened-out and un-greened-out. ...
15
votes
4
answers
4k
views
VIM syntax highlighting of html nested in yaml
Given a yaml file that contains html, like this:
template : |+
<div>Hello, world</div>
Is it possible in Vim (version 7.3.087) to highlight the html portion with html syntax ...
13
votes
5
answers
10k
views
How to override default syntax highlight in vim?
In VIM, I need to perform a simple task - highlight "(" and ")". I can do this easily by issuing two commands:
:syn match really_unique_name display "[()]"
:hi really_unique_name guifg=#FF0000
But ...
13
votes
2
answers
9k
views
Change color settings in you complete me
I installed You Complete Me with the help of Vundle in vim. The first time I used it, the suggested words were completely unreadable. They had a dark purple background and a black font color. Then I ...
13
votes
3
answers
25k
views
Vim syntax Highlighting
I have installed vim in Debian 6. I am trying to change color scheme and enable syntax highlighting. But it's not working. I added set background=dark in .vimrc file. But white background is ...
12
votes
3
answers
30k
views
MacVim gets all settings from ~/.vimrc, but not the colors and I have to source it again
I am using the following ~/.vimrc with MacVim 7.4 on MacOS X Mavericks:
set guifont=Menlo:h14
set encoding=utf8
set mouse=a
set expandtab
set ts=8
set showcmd
set nocompatible
set backspace=2
set ...
12
votes
2
answers
12k
views
Vim syntax highlighting for ruby 1.9
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 ...
12
votes
3
answers
4k
views
how to partially "link" highlighting groups?
I'm trying to do this on my .vimrc:
hi link SyntasticErrorLine SignColumn
hi link SyntasticErrorSign SignColumn
hi SyntasticErrorSign guifg=red ctermfg=red
What I want is to have the ...
12
votes
2
answers
6k
views
syntax highlighting in a VIM fold header
Is there any way to have VIM continue to apply formatting to the line used as the header for a fold?
E.g., I have the following code:
int foo(int a, int b) {
int c;
....
}
When folded, I see:
+...
12
votes
4
answers
8k
views
Vim variable syntax highlighting
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 ...
11
votes
1
answer
10k
views
vim syntax highlighting for jinja2?
How do you do jinja2 aware syntax highlighting for vim?
11
votes
3
answers
4k
views
Syntax highlighting for regular expressions in Vim
Whenever I look at regular expressions of any complexity, my eyes start to water. Is there any existing solution for giving different colors to the different kinds of symbols in a regex expression?
...
11
votes
1
answer
7k
views
Vim Conceal highlight
When using vim's conceal feature set cole=2, vim conceal the appropriate text for whatever is configured in cchar, and highlight it using Conceal group.
My problem is that I use the conceal feature ...
11
votes
1
answer
4k
views
Set visibility and/or color of listchars or conceal cchar in vim when cursorline is highlighting a line
I know that I can use set list listchars=... to show NonText and SpecialKey characters in order to highlight different kinds of, well non-text characters. In general this is straight forward and works....
10
votes
5
answers
5k
views
Why does Vim highlight all my JSON comments in red?
I've got some comments in a JSON file that were autogenerated by, and unfortunately it seems like vim can't recognize that they're just comments.
They're all red - which one of my plugins is doing ...
10
votes
1
answer
25k
views
Add syntax highlighting to certain file extensions for VIM or GVIM by default
In my Linux machine files with the .sv extension opens up by default with the verilog syntax highlighting scheme, however extension with .vor .vs don't.
I have to manually in gvim do a :set syntax=...
10
votes
6
answers
3k
views
Syntax highlighting in vim
I'm having trouble reading dark blue on black when I turn on syntax colours in vim.
How do I change some of the default colours or the colours of schemas like:
http://www.vim.org/scripts/script.php?...
9
votes
2
answers
3k
views
Set item to higher highlight priority on vim
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 ...
9
votes
4
answers
3k
views
How to make vim SpellCheck *not* code aware?
By default, vim spell checker is code aware, so it doesn't spell-check code parts of the file. In effect, in markdown it considers (pandoc multiline) tables to be codes and thus doesn't spell-check ...
8
votes
6
answers
4k
views
Vim syntax highlighting 'else:' for Python
I'm getting annoyed with the default python syntax highlighting in Vim.
It does not highlight the else: statement correctly.
Vim only highlights the else statement if I have some white space between ...
8
votes
2
answers
4k
views
In Vim, how to I set an autocommand to be run after a plugin has loaded?
One of the Vim Plugins I use has a bug, causing it to set :syntax spell notoplevel. The bug is easily mitigated if I run the command :syntax spell toplevel after opening a file. However, I'm lazy and ...
8
votes
5
answers
2k
views
VIM: How to turn off search highlight after timeout (X seconds)
I know about :nohl and use it all the time, I also use easy motion so the highlight is not in my way when just moving to the search location. It gets in my way after pressing n or N.
I am looking for ...
8
votes
3
answers
2k
views
How to exclude C++ raw string literals from syntax highlighting in Vim?
Quite honestly, raw string literals are a great addition to the C++ language. But (as expected) editors have a hard time to properly display those literals.
I am using Vim 7.4 and out-of-the-box raw ...
8
votes
1
answer
2k
views
Real SQL syntax highlighting in PHP scripts with Vim
I know it's possible to enable SQL syntax highlighting in PHP scripts using the option
let php_sql_query=1
But this just enables highlighting of all SQL keywords in every string. Even in a normal ...
8
votes
4
answers
4k
views
Syntax highlighting randomly disappears during file saving
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=...
8
votes
1
answer
2k
views
How to have a Vim multiline syntax highlight clause?
I'm trying to write the syntax highlight module for a tiny text format that includes three different kinds of list elements (starting with -, o and x respectively), and I'd like to highlight entries ...
8
votes
3
answers
3k
views
How can I teach vim about additional C language types for syntax highlighting?
Syntax highlighting works swimmingly beautiful with the standard types, like int, uint32_t, float and so on. However, I would like to teach vim that there are other types defined with typedef in my ...
8
votes
2
answers
4k
views
vim does not highlight some c++ keywords
I use vim (installed on cygwin) to write c++ programs but it does not highlight some c++ keywords such as new, delete, public, friend, try, but highlight others such as namespace, int, const, operator,...
8
votes
1
answer
2k
views
Syntax Highlighting for .gitignore in Vim?
Does anyone know of one? Question in title.