azabiong / vim-highlighter Goto Github PK
View Code? Open in Web Editor NEWHighlight words and expressions
License: MIT License
Highlight words and expressions
License: MIT License
All attempts to highlight text in visual mode fail with E16: Invalid range
. Other (built-in) vim commands succeed on the same visual selections. I've tried in a variety of types of buffers to confirm it's not an interaction with, e.g., an LSP or highlight setting.
I'm running neovim 0.9.5 with the latest version of vim-highlighter.
Hello, this plugin is very nice.
I use it to show some parts of code to students / coworkers.
One thing is missing IMHO: the possibility to highlight EXACTLY the current visual selection.
For example, for the given buffer content:
test0 test1 test2
test3 test4
If I select (in visual mode) the first test
occurence of the first line, the command :<C-U>Hi +x<cr>
will highlight the three occurences of test
of the first line. I would like to highlight only the first occurence of the first line.
If I select (in visual mode) both lines, no single command will allow me to highlight both lines.
If I select (in visual mode) some part of both lines, no command will allow me to highlight this exact selection.
Maybe am I missing some magic trick ?
Thanks anyway for the nice plugin.
highlights are missing after split window
How do I replace vim's builtin commands such as *
, n
and N
with this plugin.
let HiSet = ')'
nmap * )
nn n <Cmd>Hi><CR>
nn N <Cmd>Hi<<CR>
nn ( :nohl<CR>:Hi clear<CR>
So far I have the above bindings and it works great, except when I search with /something<cr>
.
let HiErase = 'f<BS>'
Deletes highlight from word under cursor. IMO It would be cool if cursor is not on any highlighted word, then it would remove all highlights (HiClear). Not big deal, but It would save me having to map extra mapping for HiClear (all)
First of all, thank you for the work on the plugin, it's very helpful. I have been checking the documentation, and I think what I am trying to do is not supported, but let me know if it is.
I would like to highlight some text programmatically when opening files. For example, using a command like :Hi + foo
will highlight all the foo
words in the document, without the cursor being on top of the the word at that moment, which seems to be the only way to achieve this currently.
I like this plugin very much! I got some trouble when I browse my code.
For example, I highlight some keyword and I want to find next keyword, I could use *, but I don't want change my current search pattern.In addition, some keyword was highlighted by visual select, so * was not work.
Just like this:
The cursor was on imUserNameList, and I want to goto the next "imUserNameList" position off the screen.
So, how can I do?
I am getting the below error when I try to open any file:
Error detected while processing ~/.vim/pack/azabiong/start/vim-highlighter/plugin/highlighter.vim:
line 58:
E216: No such group or event: ColorSchemePre * call highlighter#ColorScheme('pre')
Note: I am using gruvbox as my colorscheme
Hi,
It's not clear to me from reading the documentation how to re-order the colors. Can you please help me out?
whole words & ignore case, plz!
Hi the following error popped.
I'm using vim 8.1
Not an editor command: const s:FL = s:FindList
Looking forward to this one. But the install instructions seem to be cloning it in your own something or other? It asks for my name and password???
I have downloaded the zip file - if I do that it would be good to have a readme.txt to say where to put the plugin, autoload etc.
The install instructions should get me through to being able to go:
:h Highlighter
Hi, I've got such error just after install
Error detected while processing /home/user/.vim/bundle/vim-highlighter/plugin/highlighter.vim:
line 47:
E216: No such group or event: ColorSchemePre * call highlighter#ColorScheme('pre')
Can you please advise?
I didn't know this cabbrev
existed but stumbled upon it by surprise. I wanted to search for the text HI
so I typed /HI<CR>
, but then all of a sudden it was searching for Hi
instead, leaving me confused for a bit. I would rather avoid these kinds of surprises, if possible. (It's also weird that cabbrev
applies to both :
commands and /
commands but that is a "problem" with neo/vim itself).
vim-highlighter/plugin/highlighter.vim
Line 70 in e625c9a
Anyway, thanks for the incredible plugin @azabiong!
I am using Neovim v9.0.1
I am trying to unset all default keys.
In ~/.config/nvim/lua/core/plugins_config/vim-highlighter.lua
, I have the following:
vim.cmd([[
let HiMapKeys=0
]])
Hitting f
and <CR>
still triggers the default for HiSet
. Am I missing something?
Hi,
I've met these 2 errors once trying to load an existing hl file.
Error detected while processing BufWinEnter Autocommands for "*.abc"..function AbcSetKeymap[7]..highlighter#Command[42]..<SNR>225_LoadHighlight[12]..<SNR>225_SetHighlight[4]..<SNR>225_ClearPosHighlight:
line 2:
E968: Need at least one of 'id' or 'type'
Error detected while processing BufWinEnter Autocommands for "*.abc"..function AbcSetKeymap[7]..highlighter#Command[42]..<SNR>225_LoadHighlight[12]..<SNR>225_SetHighlight[11]..<SNR>225_UpdateSync:
line 10:
E684: List index out of range: 0
What I just set is like below in my vimrc
" =================== vim-highlighter
let HiSyncMode = 1
let HiBackup = 0
Could you please let me know how I can solve these 2 errors?
My vim is vim 9 and I'm using this on Ubuntu 20.04.
I think it would be useful to provide a command that sends all highlights to the quickfix/loclist so that it's possible to see all of the highlights in once place and benefit from cdo
and quickfix plugins.
Even better would be providing highlights in the quickfix/loclist too!
Hi,
I recently switched from emacs to vi and I miss some functionality from this emacs package
https://github.com/wolray/symbol-overlay
When the cursor is on a highlighted word, pressing the r key will prompt you for a replacement.
This is very handy when programming.
Another question: in the emacs plugin, when the cursor is on a highlighted word, a specific mode is entered and pressing n or p will bring you to the next or previous highlighted word. Is it possible in vi to have the same functionality?
Thanks for the great work ๐
The documentation specifies the following default maps to trigger the basic highlights:
let HiSet = 'f<CR>'
let HiErase = 'f<BS>'
let HiClear = 'f<C-L>'
let HiFind = 'f<Tab>'
Can we instead expose them as vim commands (ex: :HiSet
)? This allows us to invoke them in a more programmatic manner. (My use case is that I'm using neovim, and use lua scripting mostly).
This works well when I need to highlight a single word with a predefined color.
nnoremap <silent><leader>h1 :8 Hi+<CR>
How can I have a similar remap for a range in visual mode?
I've tried:
xnoremap <silent><leader>h1 :8 Hi+x<CR>
but I get "invalid range" error.
Any ideas?
vim-highlighter version: 0e19263
vim version: 8.2.4700
When entering to the visual mode and selecting a single character, :HiSet
will generate empty pattern (i.e., \V
) , causing Vim highlights all characters.
I noticed that :HI save doesn't support filenames with whitespaces in the path, at least on Windows OS.
E.g. :Hi save "filename with empty spaces.hl"
I have tried to place the filename inside single quote, double quote, and escape space characters, but it didn't fix the issue.
line 2254 in autoload/highlighter.vim
let l:cmd = (a:key == 'n') ? '>' : '<'
is not working for me
but when replaced by
if a:key == 'n'
let l:cmd = '>'
else
let l:cmd = '<'
endif
it works, please help
Line patterns are very useful in Vim:
*/\%l* */\%>l* */\%<l* *E951* *E1204* *E1273*
\%23l Matches in a specific line.
For example, I can highlight the Leader
just at 312th line by:
Hi+ \%312lLeader
or highlight the entire 312th line by:
Hi+ \%312l
However, vim-highlighter doesn't support patterns like this very well now (e.g., Hi-
cmd)
I think this feature is very useful!
Thanks author very much for solute my problem.
Now I found same pattern of the same buffer was different with two window.
For example
The keyword 'formDataEditor' was highligh in two window. but the color was different.
For Hi/Find formDataEditor multiple files, the color was same, but why Hi/Set word color was different for two window?
Maybe I need some config to keep color same?
See title.
Selecting a single line in visual line mode and then pressing f<CR>
causes the following error:
Error detected while processing function highlighter#Command[22]..<SNR>168_SetHighlight[28]..<SNR>168_GetVisualLine:
line 9:
E951: \% value too large
After the error is dismissed the line is successfully highlighted
Digging around, the error seems to occur at line 264 of autoload/highlighter.vim
. One guess is that it is caused by an of-by-one error and indeed changing l:right
to l:right-1
does cause the error to go away. I'm not sure what the intended purpose of the function is as the highlighting seems to work even when the error occurs so I'm not sure that this fix preserves the intended functionality of the code.
I might have missed reading something in the help file.
But if vim.keymap.set('n', 'tt', ':Hi+<CR>')
allows me to highlight a set (the equivalent of HiSet)
How do I set a keymap for HiSetSL
?
Similarly, how do you programmatically set keymaps for HiSet
and HiSetSL
in visual select mode?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.