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

Questions tagged [highlight]

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

3
votes
1answer
39 views

Highlighting only in a certain file

At every opening of a special file I want vim to automatically highlight all the lines, where the 7th character is a 1. How do I do that?
1
vote
2answers
23 views

How to set CursorLine highlight color for the gruvbox colorscheme

When I use the colorscheme gruvbox (installed with vim-plug), it overrides my configuration of the Cursorline highlight, eg set cursorline hi CursorLine cterm=NONE ctermbg=black with the same color ...
5
votes
4answers
440 views

How to highlight/match (but not search!) the word under cursor

I am searching some pattern, navigate between search results, and at the same time I want some other pattern to be highlighted. For example, I jump between invocations of some function in my project, ...
0
votes
1answer
21 views

Does `hi link XXX Normal` provide any benefits?

Does hi link XXX Normal provide any benefits? For example the syntax file included by default syntax/vim.vim includes the line: hi def link vimUserFunc Normal This often conflicts with CursorLine ...
0
votes
2answers
46 views

Priority highlighting

In my code, something like #include <whatever> is highlighted: #include (which belongs to the group 'cInclude') in pink; and <whatever> (belonging to the group 'cIncluded') in red. (Edit:...
1
vote
0answers
16 views

Highlight semicolmns when editting lua files [duplicate]

I program in both C and Lua and therefore sometimes add a semicolmn in my Lua files. This is allowed by the standard, but my company's guidelines forbid semicolmns in lua code. Therefore, I would like ...
0
votes
0answers
30 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
56 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
34 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
64 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
105 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
18 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
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
35 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
37 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
91 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
63 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
48 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
88 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
50 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
204 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
19 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
70 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
54 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
299 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
122 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
158 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
148 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
42 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 /^...
2
votes
1answer
330 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
337 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
438 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
191 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
1k 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
550 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
48 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
241 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
262 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
203 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
62 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
77 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
134 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
642 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
144 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 ...
12
votes
1answer
383 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
139 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
550 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' ...