Home Download Buy Blog Forum Support

Select from current word until next instance of current word

Select from current word until next instance of current word

Postby twoohfour on Thu Jun 21, 2012 5:23 pm

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.

Code: Select all
<<<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.
twoohfour
 
Posts: 3
Joined: Thu Jun 21, 2012 5:20 pm

Re: Select from current word until next instance of current word

Postby adzenith on Wed Jun 05, 2013 7:58 pm

I know this is way past hope but I just found this plugin and it's amazing and everything I ever wanted:
https://github.com/xavi-/sublime-selectuntil
There's a readme here: https://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.
adzenith
 
Posts: 1214
Joined: Mon Oct 19, 2009 9:12 pm

Re: Select from current word until next instance of current word

Postby facelessuser on Wed Jun 05, 2013 8:18 pm

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.

Code: Select all
{
            "name": "EOT",
            "open": "(<<<EOT)",
            "close": "(EOT;)",
            "style": "default",
            "scope_exclude": ["string", "comment"],
            "language_filter": "blacklist",
            "language_list": [],
            "find_in_sub_search": "false",
            "enabled": true
        },
facelessuser
 
Posts: 1565
Joined: Tue Apr 05, 2011 7:38 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 21 guests