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)

0
votes
1answer
12 views

Why doesn't undercurl use underline in my terminal?

:help undercurl states: "undercurl" is a curly underline. When "undercurl" is not possible then "underline" is used. In general "undercurl" and "strikethrough" is only available in the GUI. But if ...
3
votes
1answer
78 views

Get immediate feedback about a search string with no matches in vim

Is there a way to immediately get feedback about a search string with no matches? At the moment I have to press Enter first to get Pattern not found. I'd like if the background (of the search line or ...
0
votes
1answer
37 views

Change working directory color in NERDTree

Is there any ways to change the font color and background of the working directory as seen in Sublime text? Sublime Text Neovim with NERDTree
0
votes
1answer
23 views

Fold: highlight folded text only

I expected the folded text highlighted as below picture (ignore red rectangle): Like above picture, I'd like to have something to recognize that red region of a fold and highlight it only, donot have ...
0
votes
1answer
25 views

Fold: Different highlight style for fold of each filetype

Extend of this question of fold: Fold: foldtext() for each filetype We have fold for each filetype now but each fold need different highlight style of color, because highlight is global I tried to ...
0
votes
1answer
62 views

Automatic highlighting non ASCII character when loading 'vim' filetype buffer

I want to include a new highlight group and autocommand that will automatically highlight non-ASCIIs as soon as either a vimscript or a Python file is loaded in buffer (i.e. any file with filetype '...
0
votes
1answer
86 views

Vim highlighting in textfiles

I am a relative new user to vim. I started using it along with a newly set up arch installation. So when I created different netctl profiles in vim, it highlighted the parameters like shown in the ...
3
votes
4answers
1k views

How to show illegal whitespace (such as unbreakable space) in source code?

I sometimes type (by accident) shift-space, inserting unbreakable space into code. With c++, I get this: error: stray ‘\302’ in program error: stray ‘\240’ in program while in other formats (like ...
3
votes
1answer
44 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
63 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
506 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, ...
1
vote
1answer
45 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
58 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
20 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
38 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
93 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
35 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
108 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
170 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
37 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
25 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
38 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
104 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
51 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
103 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
57 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
235 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
88 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
61 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
415 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
157 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
200 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
161 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
66 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 /^...
3
votes
1answer
419 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
354 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
533 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
203 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
595 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
49 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
259 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
93 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
291 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
259 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>...