We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [highlight]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
533 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?
5
votes
2answers
1k views

Vim lost custom highlight settings after recovering from sessions

I defined some highlights in the vimrc file and it works well in gvim. However after I mksession and sourced it back, I found that some (maybe all) of the custom highlights were lost and vim used the ...
11
votes
7answers
3k views

How to search for lines matching current line in vim

I usually search for words by :/string, but if I have to search entire current line, how to do that. event: 1 beacon: 0x02 //line 1 event: 19 beacon: 0x02 //line 2 event: 1 ...
0
votes
3answers
2k 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
24 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 ...
1
vote
1answer
45 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
vote
1answer
389 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
votes
1answer
45 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
1answer
39 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
0answers
217 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
62 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 ...
0
votes
1answer
91 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,...
2
votes
1answer
1k 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' ...
2
votes
0answers
216 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 ...
3
votes
1answer
2k 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
116 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 ...
2
votes
1answer
391 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 ...
10
votes
1answer
1k views

How can I highlight matching “%” names (e.g. if/end, for/end) defined by matchit.vim on selection?

Currently my Vim highlights matching parentheses, brackets, quotes, etc. with Cyan background and white foreground -- the cursor can be moved between these with %. Thanks to my matchit.vim, I can also ...
1
vote
2answers
378 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
261 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
58 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 /^...
21
votes
3answers
9k views

Can the split separator in vim be less than a full column wide?

I use a tiling window manager (awesome) + a terminal multiplexer (tmux) + splits inside of vim. I have no window decorations at all, so you there is no visual split between them at all if the content ...
3
votes
1answer
1k 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 ...
1
vote
1answer
1k 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
235 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. ...
0
votes
2answers
808 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 ...
10
votes
1answer
4k 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.
2
votes
0answers
50 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
404 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
495 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? ...
2
votes
1answer
121 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
512 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 ...
0
votes
1answer
476 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>...
1
vote
2answers
4k views

How do I restore visual mode selection highlighting?

Somehow, over the last few days, the visual mode in Vim no longer flips the background highlight, as it used to. Now, if the file is recognized by something it can syntax highlight, it seems to ...
1
vote
1answer
79 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 ...
5
votes
2answers
178 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
1k 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 ...
1
vote
1answer
221 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. ...
12
votes
1answer
696 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 ...
11
votes
1answer
621 views

Where do custom highlighting rules belong?

Occasionally I want to override the default syntax highlighting colours and styles with my own preferences. I imagine the most appropriate way to do this would be to create my own colorscheme. ...
10
votes
1answer
2k views

Why do custom highlights in my vimrc get cleared or reset to default?

I would like to highlight (part of) my statusline with %1*, for example: set statusline=%1*%f%0* highlight User1 ctermbg=0 ctermfg=10 cterm=bold However, this always shows up as "empty" (the default ...
1
vote
0answers
315 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 ...
12
votes
3answers
678 views

Highlighted undo in Vim

I'm trying to have a highlighted undo in Vim, like spacemacs default config. Sometimes when I want quick undo's, I can't realize what changed because it's instantaneous. So I am trying to have ...
3
votes
2answers
333 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 ...
8
votes
2answers
508 views

Why does vim blink randomly when I'm navigating through code?

# vim --version VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar 31 2015 23:36:07) # cat /root/.vimrc map <F2> :w\|!sh % <cr> map <F3> :w\|!bash % <cr> map <F4> :w\|!...
1
vote
1answer
43 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 (...
5
votes
4answers
1k 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
186 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 ...
4
votes
2answers
579 views

How to highlight a search range?

I'd like to test the range pattern, same as Vim highlights the text while searching (e.g. :/), but for the range command instead. So in other words, instead of executing: :/<head/,/\/head>/d ...
3
votes
0answers
287 views

Is there a way in vim to determine if something is highlighted after search?

What I want to do is make CursorMoved autocmd that would check if there is a search highlight is on and if it is it would start a timer that would deactivate it. PS I know about all available ...