Git Product home page Git Product logo

Comments (8)

azabiong avatar azabiong commented on May 23, 2024 1

Hi, Thank you for using this tool, and I'm glad you found it's helpful.

The ability to set highlights using expressions is still in my upgrade list. I'm trying to find a good idea on how to easily erase the highlights when set using regex.

For now, it is possible to apply the pattern indirectly using Hi:save and Hi:load command.
I think you can try the following steps:
 

Firstly open a file, and clear highlights if set.
Select a word, and set highlighting, and then save it using Hi:save command with any filename, for example:

    :Hi:save test

Now open the file test.hl using:

    :Hi ls

When you open the file, you will see that the highlight pattern is saved in the following format:

    color_number : \V word

Now, you can use this form to save your patterns, For example:

    :!echo '7:\VHello' > ./hello.hl

And then, you can load it using the command:

    :Hi:load ./hello

from vim-highlighter.

azabiong avatar azabiong commented on May 23, 2024 1

Thanks for your comment. And then, I will add the feature and let you know right away.

from vim-highlighter.

azabiong avatar azabiong commented on May 23, 2024 1

Hi Miguel, I would like to inform you that a very useful feature has been added to the plugin.
Now it supports jumping to the recently set highlights using shortcuts. Please find the brief help :h Hi> and I would like to recommend that you try the suggested key map at first time. I find it really convenient.

from vim-highlighter.

azabiong avatar azabiong commented on May 23, 2024

I have another idea.

First, let's add the feature you suggested.

: Hi+ pattern

And for the erase function, currently the HiErase key can erase highlight patterns containing simple expressions.
For example:

\vHello \w+ for Hello World

However, some complex patterns may or may not be erased. But still the HiClear key will erase all the highlights.
I think the ability to set the expression when needed is more useful than the perfectly matched erase function.

So, how about adding this feature and setting it to "may or may not be erased"?

from vim-highlighter.

mpasa avatar mpasa commented on May 23, 2024

For my specific use case, having just a simple :Hi+ pattern will make me happy. I usually just clear all the patterns at the same time, or manually with the cursor under the highlight. Of course, I will let you decide whether having something it's considered incomplete is the best for the project or not.

from vim-highlighter.

azabiong avatar azabiong commented on May 23, 2024

Now it's ready. Please see the brief summary:

  :h Hi+

Hopefully you like the feature.

from vim-highlighter.

mpasa avatar mpasa commented on May 23, 2024

Oh, that was fast! Thank you a lot for your work. It works like a charm for my use case. You can feel free to close the issue.

from vim-highlighter.

azabiong avatar azabiong commented on May 23, 2024

Nice, I hope this tool helps, and be happy. Thank you

from vim-highlighter.

Related Issues (20)

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.