Questions tagged [highlight]

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

Filter by
Sorted by
Tagged with
2 votes
2 answers
105 views

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 ...
1 vote
1 answer
32 views

In Neovim is there a way at nvim level to set priorities to control highlight resolution?

Background: It's possible for multiple highlights to affect the same areas in the buffer and work correctly. For example syntax-related colors usually affect fg (foreground, text glyph) color, ...
  • 2,221
1 vote
1 answer
77 views

Display pattern count when highlighting searched pattern

Running Neovim 0.9, I have this mapping: nnoremap <silent> <leader>l :<c-u>let @/ = '\<'.expand('<cword>').'\>'\|set hlsearch<CR>wb which is a shortcut to ...
2 votes
2 answers
421 views

How to get the highlight group of the word under the cursor in Neovim with Treesitter installed?

Ok folks, I've tried all these duplicates: How to know which highlighting group is used for the background of a word? How to identify the highlight groups in use on a particular character? How to ...
0 votes
2 answers
46 views

How can I check whether the user has defined a highlight group before Vim 8.2.3917

With this question I've learned of the existence of hlget and hlID, which I use in a plugin of mine like this: if empty(hlget('SoftWrapHighlightGroup')) " do stuff endif However, those ...
  • 2,014
1 vote
2 answers
92 views

How do I let the user of my plugin customize a custom highlight group I define?

In this plugin for (soft-)wrapping only the current line, I have defined a highlight group, au ColorScheme * hi SoftWrapHighlightGroup ctermbg=NONE ctermfg=NONE, which I use here as an argument to a ...
  • 2,014
1 vote
1 answer
12 views

How to turn off highlighting/colors for changes/current edits?

Recently (within the past year?) vim has started tracking changes as I edit, and highlighting those changes with a different color. I've given it a try, but I'd like to turn that specific feature off ...
  • 113
0 votes
0 answers
14 views

Highlight variable imported with a require function in JS

What if I want to create a highlight group for this variable: const example = require (..) I want to highlight the example variable and all occurrences.
2 votes
1 answer
42 views

How to call incremental forward/reverse search inside function in Neovim?

I'm trying to implement a search function that finds a pattern and jumps to it without overriding the current searched for & highlighted pattern. Specifically, I want to be able to type out the ...
  • 447
0 votes
1 answer
34 views

How to highlight missing comma in lua files?

I often forget the comma between embedded table entries in lua code. t = { a = { "str" }, b = { { "str3", v = 1, } <<-- missing comma ...
  • 181
1 vote
1 answer
216 views

Add a border to `:LspInfo` window in Neovim

I use a transparent colorscheme for my Neovim. Due to the transparency, the :LspInfo window is difficult to distinguish from the background. Can I add a border around the window?
  • 105
2 votes
1 answer
185 views

Is it possible to make neovim use single color for underline?

As title. With my current setup it looks like this: But I only want it to use a single color. My current highlight setup: :hi IndentBlanklineContextStart IndentBlanklineContextStart xxx cterm=...
  • 1,131
1 vote
1 answer
47 views

Follow group links in :highlight command

In :highlight command, colors of some groups are shown as this: :hi vim9Comment vim9Comment xxx links to Comment I then have to invoke another :hi command, this time with the linked group as the ...
  • 5,129
0 votes
0 answers
42 views

How can I maintain the status message after `zz` command?

I like to see the number of matches in a search on the bottom right set shortmess-=S But I also like to center the screen after I search nnoremap n nzz nnoremap N Nzz nnoremap * *zz nnoremap # #zz ...
  • 149
1 vote
0 answers
47 views

Live preview the result of running a :substitute command in a :global command in neovim

Assuming the following text foo bar pattern needle pattern needle I can enter the following command :g+pattern+s/needle/replacement to replace all the needles in lines that contain pattern. With ...
  • 111
0 votes
1 answer
42 views

Fedora 35: Suddenly vi screen started looking funny!

A few days ago, vi started loading files and applying some strange highlighting. I have done nothing (on purpose anyway) to edit colors (don't know how). Can anyone explain how to fix this? Default ...
  • 103
1 vote
1 answer
50 views

Color name or number not recognized with User1-9

When I run highlight User1 ctermbg=#505050 ctermfg=#d0d0d0 gui=italic, I get the following error. E421: Color name or number not recognized: ctermbg=#505050 ctermfg=#d0d0d0 gui=italic
0 votes
1 answer
23 views

Different highlighting between foldtext and "the line number on the folded line"?

Can I control the highlighting of the foldtext separately from the color of the line number on a folded line? I want the foldtext to be quite visible while keeping my chosen line number color
1 vote
0 answers
43 views

Highlight html/xml tags using only matchit and matchparen

I would like to highlight html and xml tags, but most plugins I find (e.g. vim-matchup) look like they do way more than I'd like, which I'd like to avoid. Is it possible to highlight the tags by using ...
  • 31
1 vote
1 answer
46 views

Why are incsearch and hlsearch disabled when opening a .csv file?

I like the incsearch and hlsearch options in Vim, so early on in my .vimrc file, I have the following lines: augroup allfiles autocmd FileType * :set nocindent noexpandtab incsearch hlsearch ...
0 votes
0 answers
35 views

Can I stylize the current closed-fold line? If yes, how?

I like to have the current line highlighted (in terminal vim), but not as a punch in my eye, so what I have is this in my ~/.vimrc: au ColorScheme * \ hi CursorLine ctermbg=NONE ctermfg=NONE cterm=...
  • 2,014
0 votes
0 answers
34 views

Is there a way to highlight text but not based on syntax?

I was thinking about writing a little file viewing plugin, similar to netrw but my own thing, and I'm not sure how to highlight the files differently if there's no syntactic difference between the ...
  • 203
0 votes
1 answer
244 views

How to chain multiple script commands?

I have used this script to be able to highlight results from test reports: https://vim.fandom.com/wiki/Highlight_multiple_words When using it in Vim, it works fine when I type :Highlight 1 FAILED (For ...
  • 147
1 vote
1 answer
147 views

How to add commands from an external script to .vimrc?

I have used this script to be able to highlight results from test reports: https://vim.fandom.com/wiki/Highlight_multiple_words When using it in Vim, it works fine when I type :Highlight 1 FAILED (For ...
  • 147
0 votes
0 answers
15 views

Is there an hightlight group for the command line?

I'm referring to he line where an ex command is entered, right after I press : from normal mode. Just to give an example, let's say I want the background of the ex line to be permanently red.
  • 2,014
0 votes
1 answer
61 views

Can't read my highlighted searches

In this display, what does the "xxx" mean? :hi Search Search xxx term=reverse ctermbg=11 guibg=Yellow On my display (cygwin/xterm), Search displays as black on black. If I do this, ...
1 vote
0 answers
76 views

Wrong column highlight on lines containing references or links

I've recently taken up nvim and came accross a weird issue. I've turned on cursor position highlighting for both lines and columns (set cursorline and set cursorcolumn), and usually it works as ...
  • 111
1 vote
1 answer
33 views

highlighting: match dot in group

I have several syntax match patterns, that logically belong together. Currently I match them like this: syntax match FOO /\v<(foo1|foo2|foo3)>/ What I actually want to match is .foo1, .foo2 and ....
  • 133
1 vote
1 answer
565 views

Setting font color and underline of `highlight SpellBad`

I want hi SpellBad to be red (167 or #fb4934) and underlined. What I have right now is this: ...in vimrc... setlocal spell set spelllang=en_gb inoremap <C-l> <c-g>u<Esc>[s1z=`]a<...
0 votes
1 answer
60 views

Generate relatively unique "cache filename" for given file path (like swap files do)

For each filename, Vim generates (relatively) unique filename for it's swap cache directory. Let's say I would like to store some information for each file (like swap files do), e.g. with : silent ...
2 votes
2 answers
169 views

How to do no higlight search in a mapping?

I want to write some mappings so I can move faster between the code. The problem is that I have hlsearch on(and i don't want it off) so I did it like this: au BufNewFile,BufRead *.py nnoremap <...
  • 33
2 votes
1 answer
228 views

Stop vim from highlighting "note" in yellow inside SQL comments

I am using vim under Ubuntu under the windows WLS. When I edit SQL files, only inside comments - the word "note" is always highlighted with a background yellow color. This includes, for ...
  • 195
1 vote
1 answer
117 views

How to change the directory highlight in the terminal buffer?

I have a theme which is great apart from some minor things. I could already change the LineNr highlight and some others, but can't seem to change the directory highlight in the terminal buffer, which ...
  • 123
0 votes
0 answers
121 views

Regex multiple lines search, matched, but highlighted only what initially is on screen

Let's say I have the following fantasy code // a long definition of a structure struct long_struct { ... }; There are tons of multiple lines inside such block of code. It cannot be displayed ...
  • 121
2 votes
2 answers
98 views

Search from vim function

I am trying to use a vim function to search whether :noh has been set or not This is similar to question found here except that question does not take :noh into account One way to search from a ...
1 vote
1 answer
79 views

Scroll results of :hi

When I type :hi to see all the highlight groups, I only see as much as can fill the screen. How do I scroll through them? :hi[ghlight] List all the current highlight groups that have ...
0 votes
1 answer
139 views

How to colorize words in a buffer, using type data and position data?

I am writing a plugin for Neovim using Lua. If I have a text and some predefined arbitrary types, for example: chita wolf grizzly types: dog(green), cat(blue), bear(yellow) And I know positions/...
  • 135
1 vote
1 answer
190 views

Conceal HTML span and highlight content

I am currently writing some Anki cards in NeoVim. Anki supports HTML and I can therefore write cards in the following format. Forumlate the <span class="highlight">Central Limit ...
3 votes
1 answer
596 views

Disabling spellchecker highlight

When activating the spellchecker (with :set spell spelllang=en_us for example), all incorrect words are highlighted. I'd prefer if they'd not be highlighted, but the spell checker to continue to work (...
1 vote
1 answer
62 views

Have to hit "Enter" after searching or I lose the pattern

If I am searching for a word inside a file, if I do not hit ENTER after the search pattern, my vi loses the current match and jumps back to where it was. I have set hlsearch set incsearch in .vimrc. ...
0 votes
1 answer
167 views

Signature popup has unreadable colors in YCM for Rust

I'm using Vim 8.2 with rust highlighter and YCM plugin for auto-completion and signature help. Everything works except method signature: It has same color for both color text and bg in parts like ...
  • 143
1 vote
1 answer
165 views

Toggle specific highlight group

Is it possible to temporarily disable the text highlight under cursor? The current highlight group can be obtained by synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name'). How to clear it to ...
  • 391
0 votes
1 answer
130 views

vim/vim-latex: spell-check highlighting breaks after occurrences of \end{center}, \end{enumerate}, \end{itemize}

The highlighting of misspelled words in my LaTeX documents breaks, when I open a .tex file and jump to the bottom instead of scrolling through the whole document. Only .tex files seem to be affected, ...
  • 1
0 votes
0 answers
397 views

How do I make sure terminal vim has syntax highlighting with 'cursorline' and 'termguicolors'?

I searched this issue on the web to no avail and it's most likely not here too. The issue I'm facing goes like this I am trying to switch to vim since I find it cool. I was writing my vimrc and ...
0 votes
0 answers
183 views

How to change color of tabbar of neovim

How can I change the color of tabbar background (which is green in below screenshot)
  • 101
0 votes
1 answer
352 views

Vim highlighting: only overwrite background, not foreground color

I have highlighted keywords and characters in bold and in different fg colours (with syn match). When I create an area highlight (e.g. between [ ] or ( )) the character and keyword highlighting is ...
0 votes
1 answer
85 views

Cannot get rid of persisting highlighting

I switched from macos to linux and have spontaneous highlighting in my document. I tried to get rid of it by doing the following command without success: hi clear no syntax nohlsearch noh The ...
  • 149
0 votes
0 answers
31 views

different highlight if a certain highlight is on

I'm writing a function to highlight current word, but on commented out lines, I want a different highlight to apply. Example: Notice how the word exists is highlighed, but on a grey commented out ...
  • 121
1 vote
0 answers
215 views

stash and restore highlight colors with lua and neovim

I would like to toggle an option and with it the highlight color of Whitespace. Before setting the color with vim.api.nvim_command("hi Whitespace guifg=#ff0000") I would like to stash the ...
  • 11
0 votes
1 answer
32 views

How to put sync region start=<this> into a variable?

I have the following code: com! -nargs=* ShFoldFunctions <args> fold ShFoldFunctions syn region shFunctionOne start="^\s*[A-Za-z_0-9:,][-a-zA-Z_0-9:]*\s*()\_s*{" end="}&...
  • 213

1
2 3 4 5