This is reserved for vim questions which focus on syntax highlighting or colorscheme files.
0
votes
1answer
24 views
vim syntax highlighting on top of c.vim, “contain” doesn't quite work
I am trying to build my own Objective-C highlighting scheme for vim. The problem is that when I define some rule with contained it still being applied even if there are no rules containing this one. I ...
0
votes
1answer
25 views
Syntax Highlighting for Template Toolkit (.tt files) in VIM
My goal is to get syntax highlighting for files using extension *.tt and so far it's been a frustrating "no" every time.
I found the vim-perl plugin. Installed using legacy method 'make install' and ...
0
votes
2answers
43 views
Highlight lines longer than 80 characters in Vim doesn't work with php
I want to identify lines longer than 80 characters with Vim and I've found this solution:
match ErrorMsg '\%80v.\+'
This works in an html file or in the .vimrc file, but not in php files. I also ...
1
vote
2answers
44 views
Vim: Sudo Edit Breaks Apache Syntax Highlighting
Sudo Edit (sudo -e) allows unprivileged users to edit files securely. To achieve this, it makes a temporary copy of a file to edit and then copies it over when editing is done.
When I'm editing an ...
0
votes
3answers
73 views
VIM syntax coloring lua function name?
I'm using VIM via terminal (SSH) and want to modify my syntax coloring settings in VIM to make the function_name Yellow for Lua programming. Unfortunately, I can't figure out how to do that.
For ...
1
vote
2answers
68 views
Perl highlighting quote delimiter problems - Where can I find a syntax/perl.vim that addresses this?
I am dealing with a lot of files which have qq{...} strings that do a great job at tripping up vim making it turn the entire rest of the file green.
I have tried this perl syntax definition to no ...
0
votes
2answers
39 views
Make vim highlight python builtins when they are not followed by a dot
Is there a way to highlight built in Python functions in vim only when they are preceded by 1 more whitespaces? Furthermore, is there a modular way to do this? That is, I don't want to edit every ...
4
votes
2answers
106 views
Vim highlight regex
I have a syntax highlight for cpp to highlight STL algorithms, one line is
syn keywork cppSTL find
My problem is that on a project that I am working, there are a number of classes with a method ...
0
votes
1answer
48 views
Vim: dynamic syntax-highlighting
I want to dynamically (i.e., depending on the content of the current file) adapt syntax highlighting. While this might be useful in general, my specific setting is as follows:
The kind of files I ...
3
votes
2answers
69 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 ...
0
votes
1answer
60 views
Vim syntax highlighting for multiline fortran openmp directives
I'm using modern fortran for doing parallel programming. I'm using vim and it's been really annoying me that the fortran.vim syntax files don't seem to handle compiler directives like !$omp or !dir$. ...
1
vote
2answers
42 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 ...
0
votes
3answers
55 views
How does .vimrc set its own filetype?
In response to this question on SuperUser, I wrote a small vimscript that will detect the filetype of a symbolic link and change the syntax highlighting:
au BufNewFile,BufRead * if &syntax == ...
1
vote
1answer
57 views
How can ~/.vimrc overrule filetype.vim's bad guess for syntax highlighting?
The GLSL syntax highlighter http://www.vim.org/scripts/script.php?script_id=1002 works well. But it doesn't recognize .frag or .vert shader files that commonly begin with a line like #version 330. ...
3
votes
1answer
50 views
Superpose two vim syntax matches on the same character
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 ...
0
votes
2answers
51 views
Vim highlighting nested regions
I'm working with vim for several months now, and I still try to improve my experience with this great editor.
What I try to do is to create a syntax highlighting file for spice netlists (electronic ...
1
vote
0answers
108 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 ...
0
votes
3answers
470 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 ...
3
votes
2answers
54 views
Match the last element in a delimited list?
I have some data that is separated by colons, like this:
foo:bar:baz:qux
I want to use regex to match the last element, in this case, qux. The list may be of any length, and if it is one element ...
5
votes
2answers
164 views
Detect filetype in vim without valid file extension
I'm looking for a way to determine the filetype of a file in vim and set the syntax highlighting based on the filetype. The only catch is I cannot use the file extension for determining the filetype.
...
3
votes
1answer
71 views
vim regex & highlight syntax: find a match and ignore sub-match in it
I am trying to write syntax highlight in VIM.
How do you highlight a match within another match?
To find each match I created two syn match lines, which work where the matches are separate.
syn ...
2
votes
3answers
63 views
What vim pattern matches a number which ends with dot?
In PDP11/40 assembling language a number ends with dot is interpreted as a decimal number.
I use the following pattern but fail to match that notation, for example, 8.:
syn match asmpdp11DecNumber ...
1
vote
1answer
86 views
vim syntax folding (unintentionally) creates nested folds
I'm trying to implement vim folding into an existing syntax file for the fountain.io markup language. The existing syntax file is here: http://www.vim.org/scripts/script.php?script_id=3880
But no ...
2
votes
1answer
96 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 ...
1
vote
1answer
65 views
Vim syntax match
I am implementing a syntax highlight for a proprietary C expansion that we use in VIM.
The syntax is this:
int __event(foobar) my_foobar_function()
{
//whatever
if(foobar)
// do ...
0
votes
1answer
30 views
vim syntax scripts “sourcing” another, but only for matching lines
I'm writing a vim syntax script and I want to be able to make lines matching a certain pattern, say, '^>', "source" or imitate the markdown syntax highlighting.
Is there a way to do this at the ...
2
votes
2answers
170 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 ...
1
vote
1answer
58 views
0
votes
2answers
206 views
How to embed HTML string syntax in CoffeeScript using VIM?
I have looked at how to embed HTML syntax in JavaScript string from HTML syntax highlighting in javascript strings in vim.
However, when I use CoffeeScript I cannot get the same thing working by ...
2
votes
1answer
71 views
Vim improperly highlights “very magic” and “very nomagic” regular expressions
I'm editing a .vim syntax file in vim itself, and I'm using "very magic" and "very nomagic" regexes, simply because I think they make more sense. Unfortunately, vim does not in any way highlight these ...
1
vote
1answer
110 views
Vim syntax match first and second elements recursively
I'm trying to write a set of syntax rules for matching a nestable syntax. Basically, at the simplest level, everything is either a token or a bracket. Here's an example of such a syntax:
[
[a b ...
2
votes
1answer
54 views
Vim regex skip delimiters
I'm trying to create a vim syntax file, and I'd like to match the following bit of text:
@[one two three four]
Basically, I want to match one and two as two separate matches, and I don't care about ...
2
votes
1answer
178 views
Vim syntax highlighting for special comments
Is there a simple way in Vim to extend the syntax highlighting for a language to allow for important comments to stand out? For instance, if a line that starts with // denotes a regular comment in a C ...
1
vote
1answer
75 views
Embedded awk syntax highlighting in vim
I have a syntaxfile for highlighting awk embedded in bash script:
syn include @AWKScript syntax/awk.vim
syn region AWKScriptCode matchgroup=AWKCommand
\ start=+[=\\]\@<!'+ skip=+\\'+ end=+'+ ...
3
votes
1answer
111 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
...
3
votes
2answers
136 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 ...
4
votes
2answers
124 views
Vim maths syntax highlighting
I'm trying to improve the syntax highlighting of maths in markdown documents.
Multimarkdown uses brackets \\[ .. \\] and \\( .. \\) to indicate display and inline math respectively. I want to ...
7
votes
2answers
446 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, ...
4
votes
1answer
240 views
Highlight tabs in vim when expandtab is set
Is there a recipe to make vim highlight tab characters with a given color, but only while the expandtab option is set? I know about 'listchars', but I'd like to be able to differentiate a "valid tab" ...
2
votes
2answers
115 views
Custom syntax highlighting on current buffer in vim
From time to time I would like to apply some custom extra syntax highlighting on the current buffer.
How can this be done using the build in vim syntax/highlight system (I do not want to use the ...
3
votes
1answer
92 views
vim - how to match linked sequences in syntax file
I want to create a syntax file in vim for a custom file type I have. Part of the syntax is this line
entry: 1,02:15:00,03:15:00,56,Some String
I would like to match every part separately to assign ...
2
votes
1answer
186 views
gVim: remove syntax highlighting groups
Original title was «Language-specific color-schemes prevent simpler ones from coloring certain language-specific tags»
I'm using gVim 7.3 (on Ubuntu 12.04 Arch x86/64, for that matters).
UPDATE ...
0
votes
1answer
235 views
Strange changing background color in VIM solarized
I don't know exactly how to describe this issue, but when using solarized colorscheme theme in terminal vim, I'm noticing that when I edit some text various ends of lines (not "line-endings" but from ...
2
votes
2answers
269 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 ...
4
votes
3answers
124 views
Syntax highlighting conflict in Vim (when using keyword)
I am quite new to Vim and have the following problem:
In my .gvimrc I defined
syn keyword Todo PMID
to highlight every PMID in the files I edit. This works quite well as long as no general syntax ...
1
vote
1answer
55 views
Vim syntax regions succeeding each other orderly or disorderly
I have already asked a question about syntax highlighting, but this seems (to me) to be different and I could not find the answer in Stackoverflow.
1) Suppose I want to build a Todo list in Vim. This ...
1
vote
1answer
180 views
What can I do if vim still chooses the wrong syntax highlighter?
I'm on a system (linux) that always recognizes cpp files (*.cc) as tcl files. I don't know what file type that is, but I wanted to override it. The correct syntax highlighting is chosen if I manually ...
1
vote
2answers
142 views
Is it possible to have vim underline the scope of parentheses my cursor is currently in?
I know there is the rainbow plugin for vim that colorizes opening and closing parentheses and I know that vim can highlight the matching parentheses. I'd like vim to underline everything in the scope ...
0
votes
2answers
73 views
how can i assign indented block in vim a special syntax highlighter?
for convenience in grouping couchdb functions
i created a file format that groups separate things together using yaml
it basically contains entries in the form of name.ext: |
followed by a intended ...
1
vote
3answers
111 views
How to selectively apply syntax highlight
I'm writing a tutorial/book with Vim, and I'd like to turn off the syntax highlighting for a block of text (the normal text of the book) and reactivate it for the code examples.
I have Googled to no ...