Questions tagged [highlight]
Adding highlighting to the document other than syntax highlighting (such as hlsearch or :match)
230
questions
0
votes
1
answer
44
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 ...
1
vote
1
answer
40
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 ...
0
votes
0
answers
11
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.
0
votes
1
answer
32
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
30
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 ...
1
vote
1
answer
20
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 ....
0
votes
0
answers
34
views
Remove highlighting of a csv file in nvim 0.4.4
I have nvim 0.4.4. I tried to install a csv plugin from there, but now, when I open a csv file there is some (unwanted) highlighting as follows:
I can I remove the highlighting?
Here is my vimrc file:...
0
votes
0
answers
27
views
How to make spell ignore all Comment groups?
I am using gruvbox color theme which wasn't showing spell mistakes in terminal so I had to overwrite SpellBad. My method of doing this is this:
function! MyHighlights() abort
hi SpellBad term=NONE ...
1
vote
1
answer
150
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
46
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
65
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 <...
2
votes
1
answer
86
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 ...
1
vote
1
answer
52
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 ...
0
votes
0
answers
49
views
How can I highlight Doxygen comments in italics, in C?
Currently in my .vimrc is:
" C specifics
autocmd BufRead,BufNewFile *.h,*.c set filetype=c.doxygen
" italic comments
highlight Comment cterm=italic
This results in italic highlighting for ...
0
votes
0
answers
48
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 ...
2
votes
2
answers
49
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
52
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
41
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/...
1
vote
1
answer
73
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 ...
1
vote
1
answer
62
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
35
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
87
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 ...
1
vote
1
answer
94
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 ...
0
votes
1
answer
76
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, ...
0
votes
0
answers
236
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
80
views
How to change color of tabbar of neovim
How can I change the color of tabbar background (which is green in below screenshot)
0
votes
1
answer
134
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
55
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 ...
0
votes
0
answers
29
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 ...
1
vote
0
answers
115
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 ...
0
votes
1
answer
29
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="}&...
0
votes
1
answer
29
views
Highlight word under cursor for Go channel
I use this code to highlight:
autocmd CursorMoved * exe printf('match IncSearch /\V\<%s\>/', escape(expand('<cword>'), '/\'))
But it fail for <-done in Go:
:verbose set isk returns
...
2
votes
0
answers
74
views
Highlight groups stop working after sourcing vimrc
I'm working on a todo plugin for Neovim, using the remote plugin API.
I set highlight groups and matching patterns in my script, and then register it with call remote#host#RegisterPlugin. When Neovim ...
-1
votes
1
answer
32
views
Color a call append(line)
I have cowfortune showing up at startup and I want to color it. How do I color the call append() line? I saw some things with signs but I didn't really get it to work.
enew
setlocal
\ bufhidden=...
2
votes
2
answers
167
views
Is there a way to use matchadd() to highlight multiple lines without highlighting newlines?
Suppose I have this in a text buffer (vim --clean mydoc.txt):
One
Two
Three
Four
I highlight all lines using :call matchadd('ErrorMsg', '.*'), resulting in:
Notice that the newline character on each ...
2
votes
2
answers
397
views
Highlight Unicode Characters
Is it possible to highlight unicode characters?
When I copy/paste a code sample I sometimes run into problems because the website uses ‐, ‑, ‒ or – instead of - or some other characters that are hard ...
3
votes
2
answers
1k
views
How to highlight around of current line in Vim? [closed]
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.
1
vote
1
answer
38
views
Can you call highlight more than once? Need different colors for different matches
I am working with text files and Goyo. I'd like to highlight two different kinds of notes delimited by brackets (one called "NOTE:" and the other "TODO:") in different colors.
I ...
0
votes
2
answers
538
views
How do you change the background color for only one window?
I have tried ownsyntax but that does not work. I want do change the background color for only one window? I have tried this but it highlights all the windows.
hi Normal guibg=grey guifg=black
It ...
0
votes
1
answer
61
views
Non-regex complex color; is that possible in vim?
Is it possible to do more complex coloring than using regexes in Vim? I'm interested in implementing a feature in vim-flog where a commit and all its ancestors would be colored. That means the exact ...
3
votes
1
answer
45
views
Which highlight group is responsible for the confirmation dialog?
If I have set confirm, Vim will show a confirmation dialog if I attempt to quit Vim when there are unsaved changes:
Which highlight group is responsible for the colors of the text in the confirmation ...
1
vote
1
answer
75
views
How to use different rules for highlighting trailing whitespace inside a gitcommit diff
In my ~/.vimrc, I have:
highlight TrailingWhitespace ctermbg=blue
autocmd BufReadPost * syn match TrailingWhitespace /\s\+\%#\@<!$/
This highlights trailing spaces, except when I am still typing ...
2
votes
1
answer
70
views
Is it possible to detect a highlighted search match with synIDattr() or similar?
When I have hlsearch on and my cursor is somewhere in a highlighted search match, is it possible to detect the search highlight hl-Search with synIDattr() or a similar function?
As far as I can tell ...
4
votes
2
answers
534
views
Is it possible to override the filetype of a text file based on the first line?
I have some specifically formatted text files that I'd like to detect when I start vim. When I load these files now, the filetype is automatically set to text. I only want to override that if the ...
1
vote
1
answer
106
views
Show all instances of a certain string
I use * and # for quick and basic typo checking.
If I type AVeryLongVariableName, I can put my cursor on the word, press * and see all the other places that word is used. I know I spelled it correctly....
3
votes
1
answer
1k
views
How to highlight cursor line number without cursor line?
I want the cursor line number to have a different color than the rest of numbers when cursorline is disabled.
The highlight CursorLineNR is only active when set cursorline is set. I could do set ...
2
votes
1
answer
97
views
Print bound autocmds to a file
I would like to print all of my current autocmds to a file so that I can grep through and do further analysis.
From within vim, the list of autocmds can be found with :autocmd, but this prints to a ...
0
votes
1
answer
40
views
How to check what of highlight is the word on cursor?
I found this article,
How to know which highlighting group is used for the background of a word?
however, it prints out something not what I look for.
It prints out like
VimCommand
VimOption
...
but ...
1
vote
0
answers
152
views
How do you highlight text surrounded by double equals
I'm using vimwiki plugin with markdown. I'd like to highlight text using double equals, which isn't standard, but is quite useful. Ideally, this should replace background (for instance, yellow) and ...
0
votes
0
answers
10
views
How to get highlight style used for the text under cursor? [duplicate]
There is some text under my cursor that specific highlight is used. I do not know which highlight is that. I can type :highlight and randomly guess which could that be. Is there a method to just place ...