Sublime Forum

Select from current word until next instance of current word

#1

Hello ST community.

I’ve been searching around for some version of this. I attempted to hack BracketHighlighter to do what I’m talking about but ended up with a bit of a mess.

I have to do manual replacement of many different bodies of text in between EOT tags.

<<<EOT blablabla blablablablabla Lorem ipsum EOT;

I want a way to select that first EOT, and then hit a hotkey, and select all the text between <<<EOT and EOT; …

Is this possible? It seems that it should be.

0 Likes

#2

I know this is way past hope but I just found this plugin and it’s amazing and everything I ever wanted:
github.com/xavi-/sublime-selectuntil
There’s a readme here: github.com/adzenith/sublime-selectuntil

Basically it lets you extend each of your selections until the next instance of a search term. So if lines are roughly the same, but different lengths, you can select them all, find whatever term you like, and suddenly you have a bunch of very useful selections.

In your case, I’d find all ‘<<<EOT’, then hit the Select-Until shortcut and enter ‘EOT;’, and Bob’s your uncle.

0 Likes

#3

In BracketHighlighter, you can easily do this with the following definition. Just make sure it appears before the angle Angle definition. Oh, and make sure to define your language_list and language_filter; I left it configured below so it will highlight this in every kind of file (which really isn’t what would be desired). Then you can use the select command to select between the brackets.

{ "name": "EOT", "open": "(<<<EOT)", "close": "(EOT;)", "style": "default", "scope_exclude": "string", "comment"], "language_filter": "blacklist", "language_list": ], "find_in_sub_search": "false", "enabled": true },

0 Likes