Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Adding highlighting to the document other than syntax highlighting (such as hlsearch or :match)

0
votes
0answers
20 views

Highlighting a search capture group

By :set hl, the search result of a / expression is highlighted, for example: And if one wants to replace one substring distinguished by its surrounding, one can do so elegantly using regex capture ...
1
vote
0answers
16 views

CursorLineNR highlight not working

I have a vim configuration file (~/.vimrc) with the following settings: colo delek syntax on highlight clear CursorLine highlight clear CursorLineNR highlight clear LineNR highlight LineNR cterm=...
0
votes
1answer
30 views

How to apply a custom highlight file?

I'm playing with Vim highlight, so I made the following (syntax.vim): hi Comment ctermfg=DarkGray hi LineNR ctermfg=DarkGray hi CursorLineNR ctermfg=Red hi String ctermfg=Gray hi PreProc ctermfg=...
0
votes
1answer
33 views

How to change Operator highlight color in Vim?

I just switched to iTerm2 on macOS and found some of its options go to Vim as well. That's the case for fonts, I was able to select a Vim font that I like from iTerm options. It seems iTerm color ...
0
votes
3answers
78 views

How to highlight multiple lines?

When review code, it would be convenient if we can highlight multiple lines at the same time, instead of only current cursor line is highlighted. :set cursorline only highlight current line. :...
1
vote
0answers
15 views

Syntax - Match word based on a previous match

I want to highlight all words that have been matched in another syntax region. Using something similar to regex capture groups, for example given a file: {highlightme} asda asasd asd asd as ...
0
votes
0answers
18 views

How to highlight function like (req, res, next) -> in javascript/coffee

gvim 1-26/windows10 I'm trying some .coffee files and meet a lot with this kind of syntax (req, res, next) ->. As I know it's a call back function and I can't get it highlighted. The reason is ...
1
vote
1answer
32 views

Color Stuff Inside Braces in a Desired Way With a Trigger

Suppose I have \frac{stuff}{matter} somewhere in a file I am editing. And I want to change stuff and matter. So at the trigger of a command, I'd like to see the following take place: stuff gets ...
-1
votes
1answer
34 views

hidden highlight selection when search with * or # is active [duplicate]

Using the * key searches for the word under the cursor. Use # to do the same, backwards. When search is active, all instances of word appears highlighted. I want to know if is possible to remove the ...
0
votes
0answers
20 views

How to show the highlight color instead of cursor' white color when highlight color and cursor overlapped?

Highlight all matched characters with red color. hi! ChineseMark ctermbg=red guibg=red match ChineseMark /[\u3000\uff01-\uff5e]/ Add the two lines in my .vimrc. Here is the test.txt file.   ...
0
votes
1answer
36 views

How to color the selected character with red instead of changing it?

In my .vimrc,f5 was binded with CheckMark function to change all 。 into .. function! CheckMark() if search('。') let s:line=search('。') execute s:line . "s/。/\./g" endif ...
1
vote
1answer
77 views

How can I change the colors used for highlight search matches?

When I do a search within VIM the found text is highlighted in yellow with white letters. For my eyes it is impossible to distinguish the text highlighted. I am looking for the way to change those ...
2
votes
1answer
62 views

Why are two <cr> characters required when executing this highlighting toggle command?

I use this keymapping toggle to highlighting on and off, but when I originally found it, the author did not list two <cr> at the end of the command. I found that if I didn't have two <cr> ...
0
votes
1answer
40 views

Enable %-key jumping/highlighting for backticks (`) and single-quotes (') in M4 files

Background When working on .c and .h files, I have a couple options turned on, namely: filetype plugin on filetype indent on autocmd BufEnter *.c setlocal tabstop=8 shiftwidth=8 softtabstop=8 ...
1
vote
0answers
76 views

Normal highlight group changes cursor color in vim in xterm

I set the following highlight: :hi Normal ctermfg=250 ctermbg=235 The text is a nice light gray on dark gray, as intended. But the cursor has become dark blue. I'd love to have it just be the ...
0
votes
1answer
47 views

Highlight lines above cursor

I was looking for a way to highlight lines above the cursor line to mark them as done, whatever that means in the context of what I'm doing. I came up with this match Comment /\_.*\%#.*/ or, in words,...
1
vote
2answers
156 views

Turn off syntax hilighting for TODO items

I want to turn off the syntax highlighting for TODO items, like TODO and FIXME. How can I achieve this?
0
votes
0answers
18 views

How can I show colorful characters by tagging as I do using termcolor.colored in python?

I can print the colorful outputs in terminal using this: from termcolor import colored print(colored("this is blue", "blue") + " and " + colored("this is red and underlined.", "red", atts=['...
2
votes
0answers
59 views

Relative line number colouring

I have relative numbering turned on. There's no immediate way of telling which direction I want to move, however. For example, sometimes I see line number "7" and move 7j (7 lines down) when I really ...
2
votes
1answer
45 views

Linux gvim visual mode cursor - avoid newline selection

When I enter in visual-mode and I want to delete a block of text before the newline character (only visible if selected/highlighted in visual-mode), I accidentally always select the newline character ...
0
votes
1answer
214 views

How to set value of cterm to both bold and underline?

Currently, my vimrc has set cursorline hi CursorLine cterm=underline ctermbg=none ctermfg=none I want to be set cterm to both underline and bold
2
votes
1answer
91 views

How do you clear highlighting if you edit text?

I find it obnoxious that highlight search stays on until you manually turn it off. If I have edited some text after searching, 99% of the time that means I found what I was looking for and I don't ...
1
vote
1answer
108 views

Ignore pattern inside of a region

:h region bring me very little help. I need to exclude a pattern inside a region that should be ignored for example: don't apply match/highlight begin from # to the end of line $ I try to ignore #.*$ ...
1
vote
2answers
122 views

Highlight exported Go functions

Golang uses naming convention to separate functions visibility: exported (public) starts with a capital letter, non-exported (private) with a lower letter. I would like to highlight exported functions,...
0
votes
1answer
34 views

Vim highlights closed folds

Vim has this odd behaviour: when I launch it in a terminal emulator under X, it highlights closed folds, but when I launch it in console, closed folds' representation is more sensible: they are just ...
3
votes
1answer
52 views

How do you get two `match`es at the same time to work? [duplicate]

I have two match lines in my vimrc. they work when they are used by themselves but when i try to uncomment both i don't get any matching behavior: " highlight spaces used for indenting match Visual /^...
1
vote
1answer
250 views

Echo highlighted warning in one line

I found from the vim's manual that we can echo colored text by the following command: :echohl WarningMsg | echo "Warnging" | echohl None | echo ":Some warning" which will highlight the string ...
0
votes
0answers
308 views

Why does termguicolor disable spell checking in vim latex?

When I set termguicolor it disables spell checking highlighting in Vim, and when I disable termiguicolor, highlighting starts to work again but I get ugly colors. How could I make them work properly? ...
0
votes
1answer
334 views

Highlighting specific words automatically with different background

I am using Vim 8.0. I often pepper my Haskell code with undefined stub functions to be filled in later. Note that undefined is a valid keyword in Haskell add :: Int -> Int -> Int add a b = ...
8
votes
1answer
179 views

How to color comments after a defined column

I once was given these materials to enable this helper for vim to show kind of a vertical line in order to help enforce PEP8 rules on line length limit at column 80: " Long lines highlighting. ...
3
votes
1answer
769 views

Is there any way to change the popup menu color?

Is there any way to change the background color of the popup menu in gvim? The default background color is pink, which is a little weird to me.
0
votes
2answers
513 views

How to change the cursor line higlighting only for one window (namely the quickfix one)?

I want the cursor line in the quickfix window to be more distinguishable, than in other windows. Initially I thought that there has to be some different highlight group, it seemly turned out to be ...
2
votes
0answers
47 views

Syntax highlighting depending on whether whole line is commented

Is it possible to have vim highlight folds differently depending on whether every line in a fold is only comments or whitespace? In that case, how?
4
votes
1answer
209 views

Can I show a color from its hex value in *any* file?

We have vim-css-color to display colors in .css files. Currently I'm editing my i3wm config to match colors to a new terminal theme and it would be quite handy to be able to actually see colors I'm ...
2
votes
1answer
89 views

How to share syntax highlights files for a “new” language?

In past I asked the question about how to create syntax specifications for ChatScript, a new programming language unforeseen in standard programming languages vim set (see: Vim syntax highlighting for ...
3
votes
1answer
236 views

marks with fullline visualization

There is any solution to highlight the entire line where a mark has been inserted (e.g. with command ma)? The best could be to have marked each mark with a different color of choice. Any idea? ...
0
votes
1answer
152 views

Highlight word on double click and copy to clipboard

I am using this excellent solution by Peter Rinker to highlight all occurrences of a word on double clicking. nnoremap <silent> <2-LeftMouse> :let @/='\V\<'.escape(expand('<cword>...
0
votes
0answers
59 views

Vim puts highlight boxes at a fixed distance on every line — how to remove?

I am getting red boxes at the same point on every line. This is even true for lines that don't extend that far -- there's a red box futher on the line than I can even type. What have I done and how ...
2
votes
1answer
76 views

Can I map the number of search matches to a key?

I'd like to map 0 to whatever number of matches I currently have. For example: This here has 5 matches. If I wanted to perform a macro on every instance, i'd like to be able to simply type: 0Q (Q ...
4
votes
2answers
128 views

Keystroke to move cursor to the last character of a highlight?

In Visual Mode, you can do this using the o keystroke. However with search highlighting, ie ? or / -- I have a whole selection, but I want to move specifically to the last character of the highlight....
0
votes
1answer
530 views

vim setting bold color hightlight

Everywhere the highlight shows bold, it has a color of light yellow on my white background. This is not bold. Its unreadable. Is there anywhere I can change this color? I can clear the highlight where ...
3
votes
1answer
111 views

Why does modifying the `Normal` highlight group affect syntax not belonging to the highlight group?

Im running terminal vim, and when a syntax highlighted file is loaded and I have a colorscheme active and I run this command :hi Normal ctermbg=2 ctermfg=0 ALL text in the window changes, not just ...
11
votes
1answer
331 views

Is there an incsearch for the replace command?

I really enjoy Vim's incsearch functionality. Is there a way to have it, or something similar to it, working while I do a replacement? For example, if in normal mode I type: :%s/potato/ Can I get ...
1
vote
1answer
115 views

how can I condition a variable on my colorscheme?

I use different colorschemes depending on the color of my xterm. Some of them (in particular torte) set the background color to black, others leave the background color the same as the xterm color. ...
3
votes
1answer
465 views

Why is vim not obeying the LineNr highlighting in my vimrc?

I use vim via the console. I have the following line in my vimrc: highlight LineNr ctermfg=5 It doesn't do anything, but when I type this in as a command, it correctly changes the line numbers' ...
1
vote
0answers
121 views

Set highlighted token to blink during search and replace

When I do a global search and replace with confirm (e.g., :s/t/s/gc) I have a lot of trouble seeing which of many occurrences is currently under the cursor. I've tried the usual tricks, e.g., hi ...
4
votes
2answers
178 views

How do I get consistent behavior with matchadd color column?

After watching Damian Conway's talk, I added the following two lines to my .vimrc. highlight ColorColumn ctermbg=magenta call matchadd('ColorColumn', '\%81v', 100) My objective is to get the 81st ...
1
vote
1answer
32 views

Which highlight-group should I use for :sign define x linehl?

The sign help says: linehl={group} Highlighting group used for the whole line the sign is placed in. Most useful is defining a background color. Is there a special group I can use (...
6
votes
4answers
711 views

Stop highlighting when entering Insert mode

I would like Vim to stop highlighting matches when entering Insert mode. And not to highlight them again until a new search is performed. A first thought would be to add the following line to my ....
1
vote
1answer
122 views

How to quickly cycle through the search history?

The fact that Vim highlights the strings matched by a search expression can be useful if you are searching for visual patterns in a text. I would like to now if it was possible to quickly cycle ...