Sublime Forum

[ST3] StickySearch - persistent highlight of selected text

#1

StickySearch - persistent highlight of selected text

https://github.com/vim/StickySearch

Usage

To hightlight text under cursor:
Super + 8 for Mac OS X
Ctrl + 8 for Windows/Linux

To highlight more text (while keeping previous highlights):
Shift + Super + 8 for Mac OS X
Shift + Ctrl + 8 for Windows/Linux

To clear all highlighted text:
Alt + Super + 8 for Mac OS X
Alt + Ctrl + 8 for Windows/Linux


0 Likes

#2

Nice, I did something similar but the problem with self.clear_selection(view) is that the keyboard cursor disappears from the editor view and you have to reclick in the editor. You also lose your previous keyboard cursor position.

An alternative to keep the keyboard cursor intact is that you can use view.substr(view.sel()[0] to get the current selection and then use find_all, check out MarkLinesContaining but change sublime.HIDDEN to sublime.DRAW_OUTLINED and it should achieve the same thing as this.

0 Likes

#3

Thanks for this - fixed :smile:

0 Likes