Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
166 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 ...
0
votes
0answers
468 views

How to color the column right after the line numbers and before the beginning of line?

Would be nice to color the single column just left of the beginning of the line, but I don't think it has a group name like CursorLine. Anyone have any ideas? Maybe some simple macro would do, using ...
4
votes
2answers
2k views

Toggle highlighting of trailing whitespace

I put the following lines from this page into my ~/.vimrc to highlight trailing whitespace in red: highlight ExtraWhitespace ctermbg=red guibg=red match ExtraWhitespace /\s\+$/ autocmd BufWinEnter * ...
5
votes
2answers
406 views

Set highlight in vim function

I am trying to highlight a word in the current buffer dynamically like so: function! Highlight() let @/ = 'word' set hlsearch endfunction When I run this function, the register / contains word ...
4
votes
1answer
923 views

How to clear previous search highlight in vim? [duplicate]

After performing some search operation vim highlights its occurrences. These occurrences persist as long as editor is opened or another search is performed. How to clear previous search highlights ...
1
vote
1answer
264 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 ...
4
votes
3answers
1k views

How to disable search highlight automatically after searching?

Search highlight is very convenient for me when I'm searching, but after I'm done with doing stuff with search matches it's distracting to me, so I'm using :noh mapped to F3 everytime I've done what I ...
7
votes
0answers
501 views

Highlight line number of folded lines

I want to have uniform highlighting of line numbers (provided by the LineNr and CursorLineNr hl-groups) but the line numbers of folded lines don't obey a particular group (as far as I know), but obey ...
2
votes
0answers
614 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.
1
vote
1answer
601 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 ...
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) ...
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 ...
5
votes
1answer
974 views

Change color of misspelled words in vim-lexical

How can I change the color that is used to highlight misspelled words in vim-lexical?
4
votes
1answer
622 views

Why is `:highlight Cursor …` ignored?

My color scheme has: hi Cursor ctermfg=black ctermbg=red cterm=NONE This is confirmed using hi Curosr: Cursor xxx ctermfg=0 ctermbg=1 guifg=black guibg=orange However, I'm not ...
3
votes
2answers
243 views

How to restore a search highlight state after searching for trailing space?

I would like to: First, save the current highlight state (nohlsearch? or hlsearch?). ...the current cursor position and the current search pattern. Then search for the trailing spaces, highlighting ...
5
votes
1answer
91 views

Highlight words with no other occurence in file

Say I have a list of strings in my code, for example : var array = [ "foo", "bar", "John", "Doe", "Mary" ]; test("foo"); test("bar", "Doe"); Those strings are repeated at the ...
2
votes
1answer
592 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
56 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
0answers
298 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 ...
6
votes
1answer
2k views

How to dim characters from :set list

I like to have :set list on so that I can tell if things are spaces or tabs. My tabs show as >--- which is nice, but they are the same color are the text, is there a way to dim them so they're less ...
3
votes
3answers
106 views

Turn off highlights when pattern is entered

I find :set hlsearch useful while I am entering the pattern; but I want the effect of :noh as soon as I press enter. Is that possible?
5
votes
1answer
654 views

Search and highlight two different strings in different colors

I have a situation with typesetting a book in which the quotation marks are all screwed up. The author used a variety of marks¹ and apparently didn't believe in discriminating between them. I've ...
1
vote
2answers
57 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/...
2
votes
1answer
346 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 ...
1
vote
0answers
31 views

VIMRC changing Search Highlighting [duplicate]

My current VIMRC contains the below. I am using the correct colorscheme but it is not accepting my changes for the terminal search highlighting. If I input the :hi command by hand it works. Do I need ...
2
votes
2answers
502 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 ...
5
votes
1answer
611 views

Why does Vim highlight every dot in my code?

I program with Python and I installed python-mode with pathogen. Everything was fine but then suddenly Vim started highlighting all the dots in the files. And it's kind of frustrating. I thought it ...
1
vote
1answer
208 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 ...
10
votes
1answer
285 views

To print with search results highlighted

When we search a pattern in vim, the matches are usually highlighted. However, when we print it out, the highlights disappear. I tried both :hardcopy > my_file.pdf and :TOhtml. Neither retains the ...
3
votes
1answer
545 views

Aditional SQLite syntax highlighting in VIM

Currently I'm editing some SQLite scripts with my filetype set to ft=sql and some types aren't being highlighted and : REAL TEXT There is some configuration that I'm missing ? I've searched for a ...
1
vote
1answer
649 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 ...
2
votes
1answer
575 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
56 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?
12
votes
2answers
3k views

What is the functional difference between :nohlsearch and :set nohlsearch?

I noticed that when I use :nohlsearch that it does not actually do the same thing as :set nohlsearch. In particular, the hlsearch setting is not actually switched off (which is what :set hlsearch) ...
0
votes
1answer
707 views

Override highlight group settings with default values

I am writing a plugin that highlights buffer settings violations. I use matchadd() function. In addition I need to add patterns that are force ignored. In order to achieve that I use priorities in ...
5
votes
1answer
7k views

Modify vimdiff highlighting

For readability I try to modify my ~/.vimrc to get some proper highlighting. I found here to use e.g. this: highlight DiffChange cterm=none ctermfg=fg ctermbg=Red gui=none guifg=fg guibg=Red Like ...
8
votes
1answer
317 views

`echon` for `echomsg`

The echon and echohl commands are very useful for outputting lines of text with multiple highlight groups within the same line. This can be used to for instance create nice status messages for plugins....
1
vote
1answer
613 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 ...
13
votes
2answers
831 views

Auto Highlighting identical lines text

I saw a skilled vim ninja do this a while back but I have no idea were to start. A) Is there a way to set up vims background colour so that consecutive lines with identical content get highlighted. ...