New answers tagged

2

Prior to version 8.1.0271, in order to preview searches in this way you have to adjust your workflow slightly. First, set up your regular expression by using a normal search, during which highlighting will be active: /regular<CR> Then, you can re-use the regular expression from your search command by leaving the field blank in your substitute ...


7

This is done by setting just two options: set is hls (incremental search and highlight all matches). Make sure you've also read the appropriate help topics, excerpted below: :h 'is' While typing a search command, show where the pattern, as it was typed so far, matches. The matched string is highlighted. If the pattern is invalid or not found, ...


1

You can try hiding it using set fillchars=vert:\ hi! VertSplit guifg=black guibg=black ctermfg=black ctermbg=black Instead of black use color of your terminal or colorscheme background (not sure about various fancy terminals out there) NOTE: vert:\ the space at the end. It also works with windows terminal (preview): (you have to set fillchars, though)


0

While you have fixed VertSplit highlighting I don't see anywhere here the replacement of the actual vert 'fillchar' value. We know removing it doesn't help as it will fall back to a default value but this seems to me to be a sufficient workaround: :set fillchars=vert:\ ,..the rest.. (That's an escaped Space char.)


0

it seems like its impossible to completely remove the fillchars You can't really remove it, but you can make it invisible: " must be before setting your colorscheme augroup nosplit | au! autocmd ColorScheme * hi VertSplit ctermfg=bg guifg=bg augroup end


5

This is happening because Vim's HTML syntax will use style htmlHead to the text within the <head> block and it will link it to syntax group PreProc. (The PreProc group is meant for pre-processor directives, such as #include or #define in C/C++.) The slate colorscheme uses a white background (guibg=white) for the PreProc group, so it ends up styling ...


1

As far as I know, this isn’t possible. However, I found this neat mini-plugin in Paul Irish’s vimrc which does something close to what you’re looking for. As it stands, it highlights occurrences of the current word but I’m sure it could be updated to highlight a given string. Just add it to your vimrc and hit 1-6 to highlight the word under cursor in various ...


0

(Moved to a separate answer for visibility) According to @Christian Brabandt the characters used for this purpose are hardcoded.


0

I wrote a little plugin many years ago, and still use it. highlight_word_under_cursor.vim Previous versions used :syntax but the last iteration uses :match so it might bug you if you wanted to use :match yourself. When you land on a word it will highlight other occurrences of that word. But if you move the cursor and are still on the same word, it will ...


0

:h :highlight is used to define highlight group. What you want is the :h :match , :h matchadd() families. This is how I will do it. Goal Highlight arbitary area without staying in visual mode, all wise type should be supported. How to do it The job can be split into three main parts: Select arbitary area: There are two ways to select arbitary area in ...


1

Finding an "easy" way. The idea is to drop to linewise Visual mode and then get back restoring the command-line contents. " some regex magic to match a range pattern: " . or $ or % or number or mark or /pat/ or ?pat? or \/ or \? or \& " optionally followed by ++/--number let s:pat = '([.$%]|\d+|''[[:alnum:]''\[\]]|/.*/|\?.*\?|\[/?&])?([+-]+\d*)?' " ...


1

It's a bit complicated, I'll try to explain it in different abstraction levels. Level 0 our goal is simple: update command range highlight after entering command line update command range highlight while typing in command line clear command range highlight when leaving command line Level 1 We will use :h CmdlineEnter , :h CmdlineChanged , and :h ...


0

My SearchHighlighting plugin is one of those "visual star" plugins that @D.BenKnoble mentions in his answer; it also has a command that does exactly what you're asking for: :SearchAutoHighlighting selection


Top 50 recent answers are included