azabiong / vim-highlighter

Highlight words and expressions
MIT License
226 stars 9 forks source link

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

Closed JS-Zheng closed 1 year ago

JS-Zheng commented 1 year ago

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!

azabiong commented 1 year ago

That's a good idea! 👍 I will think about how to do that, thanks!

azabiong commented 1 year ago

Now it supports that 😄 Currently, only the function to erase the exact same pattern set by the "Hi+" command is supported. And I think that the function can be gradually expanded in the future.

azabiong commented 1 year ago

Now it also supports HiErase key function. I hope you like it! 😄

JS-Zheng commented 1 year ago

It works great! Thank you, @azabiong, for the awesome feature! 😇

azabiong commented 1 year ago

Hi Jason, now HiSetSL key mapping also supports highlighting in a specific line, and it looks convenient! 😄 →  Highlights in a specific line