Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

highlight match all occurrences (Vintage/Ex), not word under cursor #41

Open
cre8value opened this issue Mar 1, 2013 · 8 comments
Open

Comments

@cre8value
Copy link

Great plugin, looking to tweak it so that it works like Vim match behavior.
Is there a way to config WordHighlight to only highlight matches in Vintage mode or VintageEx instead of the word under cursor? And to keep matches highlighted until new search word is searched for, no matter what word my cursor is on?

Here is what it looks like in Vim after I type: /highlight
No matter where I move my cursor, all occurrences of 'highlight' will be highlighted in red until I search for a new phrase. Can this be done with WordHighlight?

image

@adzenith
Copy link
Member

adzenith commented Mar 1, 2013

No, it can't do that.

@cre8value
Copy link
Author

Thank you for the quick response. Any suggestions on how to accomplish that behavior in ST2 or where to find the resources on how to implement something like that? Going into Insert mode and then hitting ALT F3 or CTRL-F then ENTER just isn't the same for us coming from years of Vim. Thanks again.

@adzenith
Copy link
Member

adzenith commented Mar 1, 2013

What does Sublime Text do right now? If you search and then move your cursor, you lose the search?
You'd have to write a plugin. You could probably adapt WordHighlight pretty easily, actually. I don't use VI mode, though, so I can't really speak about how I'd integrate it.

@cre8value
Copy link
Author

Correct, upon cursor move it loses highlight. Plus it doesn't highlight all occurrences.

image

@fabd
Copy link

fabd commented Sep 18, 2018

As an aside coming from vim/gvim as well (with Vintage Mode enabled) the reason why I searched for a better highlight plugin is probably one of the best shortcuts in vim:

Pressing * (star) in gvim as well as Sublime Text 3, searches for the current word. And in both vim and ST3, pressing n or shift-n afterwards will move to the next / previous match.

This is incredibly simple and useful. I use this all the time when refactoring or just reading code I wrote some time ago. Press * on a variable and you can instantly see where it's used.

However unlike vim, in ST3 (+ Vintage Mode) when you press * the matches are not highlighted at all (including with this package).

Do you think it's possible to mod this plugin to do the matches highlighting when I press *? I can try to do that myself.. I've just never looked into the ST3 plugin system.

ps: Ok, with this package, if I double click a word, I see the matches. That's an improvement. However I can't automatically move to the next/prev matches with n / shift N. i'd like to make that double click functioanlity work with * and then be able to navigate the matches.

@adzenith
Copy link
Member

Sublime Text has this built in, I think, but only if you have the find panel open. Try pressing cmd+f (or ctrl+f on win/lin) and then go back in your buffer and see if when you press * everything gets highlighted.

@harouwu
Copy link

harouwu commented Mar 13, 2019

As an aside coming from vim/gvim as well (with Vintage Mode enabled) the reason why I searched for a better highlight plugin is probably one of the best shortcuts in vim:

Pressing * (star) in gvim as well as Sublime Text 3, searches for the current word. And in both vim and ST3, pressing n or shift-n afterwards will move to the next / previous match.

This is incredibly simple and useful. I use this all the time when refactoring or just reading code I wrote some time ago. Press * on a variable and you can instantly see where it's used.

However unlike vim, in ST3 (+ Vintage Mode) when you press * the matches are not highlighted at all (including with this package).

Do you think it's possible to mod this plugin to do the matches highlighting when I press *? I can try to do that myself.. I've just never looked into the ST3 plugin system.

ps: Ok, with this package, if I double click a word, I see the matches. That's an improvement. However I can't automatically move to the next/prev matches with n / shift N. i'd like to make that double click functioanlity work with * and then be able to navigate the matches.

Hey I am having similar issue here. Do you happen to find a solution for that?

@harouwu
Copy link

harouwu commented Mar 13, 2019

Sublime Text has this built in, I think, but only if you have the find panel open. Try pressing cmd+f (or ctrl+f on win/lin) and then go back in your buffer and see if when you press * everything gets highlighted.

I have search panel opens, but I can only press * again after using mouse to click on the searched word. It would be really good if I can keep pressing * with highlighted keywords without using my mouse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants