Stack Exchange Network

Stack Exchange network consists of 175 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
0answers
236 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 ...
2
votes
1answer
976 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
2answers
468 views

Toggle bold highlighting for comments in term/GUI

Currently, I use this: map <F7> <Esc>:if has("gui_running")<Bar>hi comment gui=bold<Bar>else<Bar>hi comment cterm=bold<Bar>endif<LF> It turns comments bold ...
2
votes
1answer
408 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
285 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 ...
2
votes
1answer
549 views

Make Vim highlight the match for the paren *before* the cursor

I've had a look at :h matchparen, and it doesn't seem to have an option for highlighting the match for the parenthesis immediately before the cursor. In short, this is what I want: Matchparen should ...
2
votes
1answer
501 views

change color of section dynamically in vimscript

Is there a way to set the text color of an ad-hoc selection in vimscript? Something like: " change the text color of the first three rows to red :1,3 call changeTextColor('red')
2
votes
1answer
67 views

How to know which highlighting group is used for the background of a word?

Vim highlights the background of certain words (e.g. when doing spellchecking) in a way that I would like to change (because the background and the word itself are almost of the same color, which ...
2
votes
1answer
115 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 ...
2
votes
1answer
922 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
1answer
69 views

Autocmd overshadowing?

I'm using the ntpeters/vim-better-whitespace plugin to automatically highlight trailing whitespaces (and removing them). I also want to highlight "irregular" whitespace characters, such as  (U+00A0) ...
2
votes
1answer
54 views

CursorColumn isn't a continuous line anymore when wordwrap is on

Screen capture says it all: Normally, the vertical highlighting is continuous, but because I have long lines word-wrapping around, only one character gets highlighted. Is there a way to fix this?
2
votes
1answer
101 views

Highlighting tabs, trailing space and non-breaking space by colors, not chars

Currently I highlight these with: set listchars=tab:▶—,trail:␣,nbsp:⍽ But the drawback is I cannot usefully copy-paste from the terminal where vim resides to another one: e.g. suppose I'm editing a ...
2
votes
2answers
99 views

Can I use a different color for the selected match than for other matches

In the screencast below I searched statusline and then cycle through the results with n. Is it possible to highlight the selected match with a different color than the other matches, instead of ...
2
votes
1answer
44 views

How do I hide a TeX macro and highlight the arguments?

I have to put a macro in front of Greek text to get correct hyphenation, such that I have, e.g.: possibly \textgreek{κινούμενον} and possibly not. Could I use conceal to conceal the macro and show ...
2
votes
1answer
94 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
311 views

how to change visual selector color with xoria256 colorscheme

I would like to change the visual highlight color in xoria256 colorscheme to the following: make the background brighter but keep the color of the letters the same. I've seen people do it and I ...
2
votes
1answer
75 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> ...
2
votes
0answers
141 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
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?
2
votes
0answers
546 views

multiple highlight with multiple color

When we search for a word, it gets highlighted. I want to search for another word keeping the previous one highlighted (with a different color probably). Please let me know if it's doable.
2
votes
0answers
281 views

Cursor line and cursor column highlighting “priorities” are inconsistent

I have turned on cursorline and cursorcolumn options to highlight cursor line and cursor column, but there is some inconsistency in the behavior. The CursorLine highlighting seems to have a lower ...
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
2answers
406 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?
1
vote
2answers
296 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,...
1
vote
1answer
549 views

Automatically call matchadd() in every new window without producing duplicate entries

I started off with the following line in my vimrc: call matchadd(...) This applies a highlight to the current window. However, if I split a new window, that window will not have the highlight ...
1
vote
1answer
106 views

Why does this auto command to disable hlsearch not work?

I like having hlsearch on, but find it annoying in insert mode. So I tried doing the following autocommand to disable it whenever I enter insert mode: autocmd InsertEnter * nohlsearch For whatever ...
1
vote
2answers
35 views

Highlight current line, but not for files inside certain dirs

I'd like to be able to highlight the current line the cursor is at, but not for files from certain directories. That's because I noticed the rendering becomes slow if I highlight the lines within a ...
1
vote
1answer
612 views

vimrc contents selectively (i.e. highlight) ignored

This one beats me after 30 years of vi/vim usage... Context: I'm on FreeBSD using the latest vim (7.4.796). A month or so ago, syntax highlighting in xterm(318) started acting up. In particular, the ...
1
vote
1answer
241 views

Why doesn't search for word under cursor (* and #) turn on search highlighting and how do I enable it?

I can't find info in help about whether it should or shouldn't turn on highlighting, but I find it strange that I have to press n or N after * or # to turn on search highlighting. How do I enable ...
1
vote
2answers
55 views

Keybindings to turn on/off higlight group

I have this keymap: map <F3> :hi Tab gui=underline guifg=8 ctermbg=8<CR> and I know that, I can clear group by :hi clear Tab, but how to map only F3 to do this? I want one key to turn on/...
1
vote
1answer
30 views

Automatically highlight all occurrences of the selected text in visual mode

In text editors like sublime text, atom and notepad++, when you select a word, all matches are highlighted automatically as shown in the following screenshot of my atom editor: I use v and select ...
1
vote
1answer
62 views

Change background color of git conflict marker sections

If git is performing a 3-way merge and has a conflict it can't resolve, it marks up that area of the file like this: No unresolvable conflicts here <<<<<<< HEAD xyz ||||||| ...
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 ...
1
vote
1answer
37 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 (...
1
vote
1answer
854 views

Vim ignoring ctermfg color value

I have the following in my .vimrc file: hi clear SpellBad hi SpellBad cterm=underline,bold ctermfg=196 ctermbg=NONE To make misspelled words red. Vim makes them only underlined and bold, but not ...
1
vote
1answer
113 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 ...
1
vote
1answer
39 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
326 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
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 = ...
1
vote
1answer
196 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. ...
1
vote
1answer
169 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 ...
1
vote
1answer
176 views

Motion key for next highlighted item?

Using the normal spell-check mechanism in vim one can jump from one misspelling to the next using ]s. Sadly vim's spell-check is completely useless for Turkish. Using the vimchant plugin that hooks ...
1
vote
1answer
575 views

hi StatusLine cterm=none displays whitespace characters

I don't like the cterm=reverse used on the StatusLine. Without reverse, I also don't care for bold, so I ended up with hi StatusLine cterm=none in my .vimrc. However, this lead the spaces caused by ...
1
vote
1answer
272 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 ...
1
vote
1answer
459 views

How to use a variable value in a colorscheme

I'm trying to make a colorscheme configurable where I define the style in a variable defined in my .vimrc. let g:plugin_style='<vim-highlighting-style>' Then in the colorscheme I'm doing: ...
1
vote
2answers
153 views

Keep matchadd and matchaddpos up to date after file changes

I'm trying to write a plugin to highlight overused words in a file. After this question I now have a way to highlight the most frequent words in each paragraph. To restrict the highlighting of a word ...
1
vote
0answers
29 views

How do you remap keys in :history or :highlight?

I use Colemak hnei for nav in normal mode, but my keys default to hjkl when when I'm viewing :history and :highlight. How do I remap these keys? My guess is that the program may be switching to more....
1
vote
2answers
298 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 ...
1
vote
0answers
22 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 ...