51 questions
77
votes
11
answers
68k
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 ...
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>...
6
votes
1
answer
4k
views
HTML syntax highlighting in javascript strings in vim
I don't know if this is possible/sensible, but I was curious to know if I can have my strings in javascript files have html highlighting. I discovered that strings in php could have SQL syntax ...
13
votes
5
answers
11k
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 if ...
32
votes
4
answers
13k
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 ...
12
votes
4
answers
9k
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 ...
9
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
3
answers
12k
views
Changing filetype based on file extention in vim
I want to change the filetype based on file extension in vim.
I have the following code in the my .vimrc
autocmd BufNew,BufNewFile,BufRead *.txt,*.text,*.md,*.markdown setlocal ft=markdown
But when ...
5
votes
1
answer
953
views
vim syntax: match only when between other matches
I am trying to create a syntax file for my logfiles. They take the format:
[time] LEVEL filepath:line - message
My syntax file looks like this:
:syn region logTime start=+^\[+ end=+\] +me=e-1
:syn ...
4
votes
2
answers
4k
views
Set colors for custom syntax keywords in Vim?
I'm using a syntax file in vim that defines a number of filetype-specific syntax keywords. To color files of this type I've also created a colorscheme file for the share directory that attempts to ...
94
votes
13
answers
91k
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 ...
52
votes
5
answers
49k
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 ...
31
votes
2
answers
10k
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 ...
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 ...
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?...
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=...
6
votes
2
answers
968
views
In VIM, is there any way to define syn region for template angle brackets without clashing with less than sign?
As for {,} and [,] and (, ), I really would like to be able to define syntax region for <, > to be used for C++ template usage like the following:
a<b>
But, is there any way to create ...
5
votes
4
answers
13k
views
VIM highlight matching begin/end
I'm trying to find a plugin that will highlight the matching begin/end statements with Verilog. VIM has it working with curly braces /brackets but it does not work with its begin/end. I want VIM to ...
4
votes
1
answer
3k
views
Syntax highlight for Sass is not working in Vim
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
...
3
votes
2
answers
1k
views
Highlight SQL inside Python string literals
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 ...
3
votes
1
answer
1k
views
Vim syntax files: add to cterm
Consider a simple text markup language where _underscores denote italics_ and *astrisks denote bold*.
In an imaginary vim syntax file you might have
syntax region italic start='_' end='_' keepend
...
2
votes
2
answers
1k
views
Vim syntax highlighting
Alright, this is probably a stupid question, but....
I've got a file of source code in a proprietary language. I want to edit said file with VIM, instead of their crummy editor. I'd like basic syntax ...
2
votes
1
answer
360
views
Superpose two vim syntax matches on the same character [duplicate]
I'm defining the following syntax rules in a vimscript:
hi MyBold term=bold gui=bold
hi MyRed ctermfg=red guifg=#ff0000
And later on, I want to apply both highlights to the same character. So ...
1
vote
1
answer
1k
views
How do I create Vim syntax highlighting rules that are common to all filetypes?
I'm trying to highlight trailing whitespace in vim, regardless of filetype.
I'm able to do it on a per-filetype basis. For example, for HTML:
~/.vim/ftplugin/html.vim
color html
~/.vim/syntax/html....
0
votes
1
answer
721
views
Number pane not being highlighted in vim dracula theme
I am using dracula theme for vim and am not able to get the number pane, that is, the side panel which contains the line numbers, to be displayed in a sort of translucent manner. The preview image ...