Comments (8)
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.
Thanks for your comment. And then, I will add the feature and let you know right away.
from vim-highlighter.
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.
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.
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.
Now it's ready. Please see the brief summary:
:h Hi+
Hopefully you like the feature.
from vim-highlighter.
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.
Nice, I hope this tool helps, and be happy. Thank you
from vim-highlighter.
Related Issues (20)
- Clear all when cursor is not on any highlight HOT 7
- Feature Request: Send highlights to quickfix/loclist HOT 10
- Question: How to replace builtin n, N and * commands. HOT 5
- install instructions HOT 1
- autoload highlight after split window HOT 1
- Error while creating a highlighting while selecting a single line with visual line mode HOT 3
- Feature Request: add support for line-pattern (\%l) HOT 5
- Getting No such group or event error HOT 2
- Unable to save when whitespaces in the path HOT 2
- whole words & ignore case HOT 1
- Visual Mode remap HOT 2
- Feature request: replacement HOT 6
- Feature request: highlight a large visual selection (possibly on multiple lines) HOT 20
- Can we expose HiSet, HiErase etc as vim commands? HOT 3
- HiSense('N') not working HOT 2
- HiMapKeys doesnt seem to work HOT 6
- How to programmatically set HiSetSL and HiSet (visual mode) HOT 6
- Is there a way to disable the command line abbreviation? HOT 3
- 2 Errors once loading hl file HOT 7
- [Question] The highlight's color was different from two window. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-highlighter.