Home Download Buy Blog Forum Support

How do a collapse parts of multiple lines

How do a collapse parts of multiple lines

Postby euchoreo on Wed Sep 18, 2013 8:05 pm

I noticed that Ctrl+shift+[ can be used to collapse something I've selected with sublime text

So, if I have a line
command("",executeCommand,....many.. parameters)

I can select just the parameters to the function command and collapse\fold it. My question is, what if I have 50 lines of this? Ie

command("",executeCommand,....many.. parameters)
command("",executeCommand,.........................many.. parameters)
command("",executeCommand,......many.. parameters)
command("",executeCommand,many,parameters)
command("",executeCommand,1 param)
....

How can I quickly select and collapse all of the parameters in this case?
euchoreo
 
Posts: 15
Joined: Fri Aug 30, 2013 8:19 pm

Re: How do a collapse parts of multiple lines

Postby adzenith on Thu Sep 19, 2013 1:23 am

click on the first executeCommand
press cmd+d 49 times
press cmd+shift+right (or shift+end)
collapse it all with your collapse shortcut.

Sublime Text has really good multiple selection support.
Last edited by adzenith on Thu Sep 19, 2013 1:25 am, edited 1 time in total.
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: How do a collapse parts of multiple lines

Postby adzenith on Thu Sep 19, 2013 1:25 am

Here's another way:

select all 50 lines (with the mouse, maybe?)
hit cmd+shift+l
hit cmd+left (or Home, I guess, if you're on Windows)
hit option+right (ctrl+right?) a couple times
then press cmd+shift+right or shift+End, as above, and collapse it.
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: How do a collapse parts of multiple lines

Postby quodlibet on Thu Sep 19, 2013 9:23 pm

adzenith wrote:select all 50 lines (with the mouse, maybe?)


Assuming you aren't being picky, you can select the first executeCommand and then expand the selection to the rest with Quick Find All (Alt+F3 on Win/Linux; not sure on OSX.).
quodlibet
 
Posts: 544
Joined: Sat Jun 18, 2011 5:53 pm

Re: How do a collapse parts of multiple lines

Postby euchoreo on Thu Sep 19, 2013 10:04 pm

Heck yeah! Thanks guys

I went with select, alt-F3, right arrow into params shift+end, shift-left arrow to unselect semicolon, ctrl+shift+[

I even convinced a coworker to adopt sublime in the process.
euchoreo
 
Posts: 15
Joined: Fri Aug 30, 2013 8:19 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 23 guests