Giter Site home page Giter Site logo

vim-highlighter's People

Contributors

azabiong avatar id01cg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vim-highlighter's Issues

Visual mode highlighting fails

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.

Feature request: highlight a large visual selection (possibly on multiple lines)

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.

Question: How to replace builtin n, N and * commands.

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>.

Clear all when cursor is not on any highlight

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)

Add highlight programmaticaly

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.

[Question] How to navigate highlighters in current buffer?

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?

Getting No such group or event error

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

How to re-order colors

Hi,

It's not clear to me from reading the documentation how to re-order the colors. Can you please help me out?

install instructions

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

Is there a way to disable the command line abbreviation?

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).

Anyway, thanks for the incredible plugin @azabiong!

HiMapKeys doesnt seem to work

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?

2 Errors once loading hl file

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.

Feature Request: Send highlights to quickfix/loclist

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!

Feature request: replacement

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 ๐Ÿ‘

Can we expose HiSet, HiErase etc as vim commands?

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).

Visual Mode remap

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?

Can't highlight a single character

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.

Unable to save when whitespaces in the path

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.

HiSense('N') not working

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

Feature Request: add support for line-pattern (\%l)

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

ๆˆชๅœ– 2022-11-09 00 48 47

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!

[Question] The highlight's color was different from two window.

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?

Error while creating a highlighting while selecting a single line with visual line mode

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.

How to programmatically set HiSetSL and HiSet (visual mode)

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.