Questions tagged [highlight]

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

258 questions
13
votes
5 answers

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, usually there is a variable named "session"…
lesnik
  • 451
  • 2
  • 4
  • 13
10
votes
1 answer

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 distracting?
Captain Man
  • 475
  • 1
  • 5
  • 9
8
votes
1 answer

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 getting the desired color in cygwin's mintty. When the…
user2153235
  • 905
  • 5
  • 14
5
votes
1 answer

How to fix unreadable highlighted text during search?

This is an example of how highlighted text looks in my vim: In the color scheme I am using (/usr/share/vim/vim82/colors/peachpuff.vim) the color is defined like this: hi Search term=reverse ctermbg=3 guibg=Gold2 When I change this particular color…
lesnik
  • 451
  • 2
  • 4
  • 13
5
votes
1 answer

Highlighting arbitrary text

When I'm writing, I often have 2-3 buffers open. My main body of text in the middle, and then supporting materials on the left and right. I often read a paragraph from one of the supporting buffers then switch back to the primary to write for a…
Harv
  • 219
  • 2
  • 11
5
votes
4 answers

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 text in vim but how can I obtain all highlight…
as2d3
  • 153
  • 1
  • 1
  • 4
4
votes
3 answers

Is there anything like matchaddpos() but stick the highlight with the character instead of grid?

Assume we have this text: baaa matchaddpos("Error", [[1,2]]) highlights the second character (the first 'a') as "Error" group. baaa ^ highlighted When I insert a 'b' at the beginning, it becomes bbaaa ^ highlighted It looks like the color is…
Giumo
  • 43
  • 4
3
votes
3 answers

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?
Toothrot
  • 3,129
  • 13
  • 27
3
votes
2 answers

How to highlight around of current line in Vim?

I want to highlight around of current line in Vim like VSCode. Edit: I want to highlight up, left, down, and right of current line.
sbh
  • 53
  • 1
  • 6
3
votes
1 answer

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?
quiliup
  • 155
  • 4
2
votes
0 answers

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 priority than other syntax highlighting, so the usual…
Alexey
  • 521
  • 2
  • 16
2
votes
3 answers

How to automatically change the background color of the active split?

I use several splits (windows). To quickly identify the splits that has the focus I would like Vim to auromatically adapt the background color of the active split. Is there a way to do so? Is it possible to have a different definition of the…
Vivian De Smedt
  • 16,336
  • 3
  • 18
  • 37
2
votes
1 answer

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?
Gantron
  • 21
  • 1
2
votes
2 answers

Highlight important words/lines permanently

I'm working on a plain text file. I'd like to highlight important words or lines so that they stand out. How can I change background color and/or text color for selected text or word under cursor? UPDATE By permanent I meant that the highlighting…
Salahuddin Ahmed
  • 441
  • 3
  • 14
2
votes
3 answers

Turn off syntax highlighting for TODO items

I want to turn off the syntax highlighting for TODO items, like TODO and FIXME. How can I achieve this?
nijoakim
  • 163
  • 7
1
2