Questions tagged [highlight]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
28 views

Can I make tagbar plugin highlighting the function my cursor is on?

I want this highlight appear on the tagbar plugin window. Can I?
Jumogehn's user avatar
  • 165
1 vote
0 answers
23 views

How to add a syntax rule to LaTeX filetype?

How can I colorize elements of the regex rule "\w\+:\w\+:\d\{4\}" in a LaTeX file ? If I open a new document with no filetype and add the two following command : syn match Bib3Dots '\w\+:\w\+...
chuugar's user avatar
  • 11
1 vote
2 answers
207 views

Highlight the full text searched on vi editor?

We've only vi editor on servers (There are 100+ of them so installing vim in each of them is not really an option as that's not our servers as we're just providing a service to others). No ...
achhainsan's user avatar
1 vote
1 answer
217 views

How do I change the color of the deleted text on the left side of a vimdiff?

My colors currently look like this, with the text highlighted green on both sides: I would like it to be red on the left, and green on the right. I tried to change the DiffDelete highlight, but that ...
vinnydiehl's user avatar
1 vote
3 answers
112 views

How to efficiently highlight a region given a START and END position expressed as line_nr, col_nr?

Say that I want to highlight a region expressed in terms of two coordinates of the form (line, column), e.g. C1 = (l1, c1) to C2 = (l2, c2). I read :h matchaddpos() but it seems that you can only ...
Barzi2001's user avatar
  • 498
0 votes
0 answers
80 views

nvim-qt on Windows, cursor highlight color not work

I use nvim-qt on windows 10, and i set the cursor highlight color by: highlight Cursor guifg=Red guibg=Green highlight iCursor guifg=Red guibg=Green set guicursor=n:block-Cursor/lCursor but it does ...
tyts9874's user avatar
0 votes
0 answers
21 views

autocmd to set hls after having manually :nohls doesn't turn search highlighing on

tl;dr Why, after sourceing the following, moving the cursor doesn't result in the text matching the / being highlighted? set hls augroup AU_NAME autocmd! autocmd CursorMoved * set hls augroup END ...
Enlico's user avatar
  • 2,184
1 vote
2 answers
168 views

How do I check a buffer for words from a list?

I'm wondering how to: Check the presence in the current buffer of words that are present in a given file and Highlight them.
schmendrich's user avatar
1 vote
1 answer
617 views

Syntax highlighting breaks with rust analyzer

I have been using neovim for several months with basically no issue and enjoying it very much. I have recently started receiving a problem with the syntax highlighting in Rust. When the file first ...
funnyboy_roks's user avatar
1 vote
1 answer
54 views

Why does the cursor on my Vim appear in pairs when it encounters parentheses?

I don't know what to touch. When my cursor moves to the left of the parentheses, the right side of the parentheses is also covered by the cursor. Is there any way to make my cursor only cover the left ...
zjswantbe's user avatar
0 votes
0 answers
44 views

How to highlight all the columns of a window?

Consider the following snippet: vim9script var winid = win_getid() var winwidth = winwidth(winid) var range = [] for lnum in range(10, 20) add(range, [lnum, 0, winwidth(winid)]) endfor var m = ...
Barzi2001's user avatar
  • 498
2 votes
3 answers
593 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 ...
Vivian De Smedt's user avatar
1 vote
1 answer
612 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, ...
Steven Lu's user avatar
  • 2,241
1 vote
1 answer
122 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 ...
reject-cookies's user avatar
7 votes
3 answers
5k 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 ...
artfulrobot's user avatar
0 votes
2 answers
106 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 ...
Enlico's user avatar
  • 2,184
1 vote
2 answers
123 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 ...
Enlico's user avatar
  • 2,184
1 vote
1 answer
23 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 ...
Angelo's user avatar
  • 113
3 votes
1 answer
92 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 ...
WalksB's user avatar
  • 507
0 votes
1 answer
68 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 ...
Mattia72's user avatar
  • 191
1 vote
1 answer
940 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?
Diwas10's user avatar
  • 115
2 votes
1 answer
734 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=...
NeoZoom.lua's user avatar
  • 1,382
4 votes
2 answers
159 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 ...
3N4N's user avatar
  • 5,614
0 votes
0 answers
54 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 ...
nullromo's user avatar
  • 161
1 vote
0 answers
240 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 ...
alcroito's user avatar
  • 111
0 votes
1 answer
49 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 ...
mike65535's user avatar
  • 103
1 vote
1 answer
179 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
SingularisArt's user avatar
0 votes
1 answer
72 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
Aaron Parisi's user avatar
1 vote
0 answers
79 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 ...
ElPC's user avatar
  • 31
1 vote
1 answer
69 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 ...
Gern Blanston's user avatar
0 votes
0 answers
77 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=...
Enlico's user avatar
  • 2,184
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 ...
Jake's user avatar
  • 213
1 vote
1 answer
695 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 ...
Opifex's user avatar
  • 217
1 vote
1 answer
314 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 ...
Opifex's user avatar
  • 217
0 votes
1 answer
120 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, ...
n952162's user avatar
1 vote
0 answers
121 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 ...
Vlad's user avatar
  • 111
1 vote
1 answer
71 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 ....
earthling's user avatar
  • 133
1 vote
1 answer
903 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<...
grepgrok's user avatar
0 votes
1 answer
65 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 ...
Grzegorz Wierzowiecki's user avatar
2 votes
2 answers
416 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 <...
Udalny's user avatar
  • 33
3 votes
1 answer
373 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 ...
Bruce's user avatar
  • 205
1 vote
1 answer
136 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 ...
neolith's user avatar
  • 133
0 votes
0 answers
156 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 ...
haxpor's user avatar
  • 121
2 votes
2 answers
144 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 ...
Clark Taylor's user avatar
1 vote
1 answer
108 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 ...
Shaun Lebron's user avatar
0 votes
1 answer
305 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/...
dimus's user avatar
  • 145
1 vote
1 answer
298 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 ...
rkvymvqt's user avatar
4 votes
1 answer
1k 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 (...
Luiz Martins's user avatar
1 vote
1 answer
132 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. ...
transient_loop's user avatar
0 votes
1 answer
249 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 ...
d9ngle's user avatar
  • 163

1
2 3 4 5 6