My circumstance:
I'm working with Fortran. Sometimes, I want to select everything that's within a block of code. It's easy for me to select the start/end elements of a block because it all look like this:
SUBROUTINE FOO(BAR)
IF (BAR .GT. 1) THEN
//DO SOMETHING
ENDIF
RETURN
END SUBROUTINE FOO
Move the cursor to SUBROUTINE
, Hit Ctrl+D
twice, done. Both instances of the SUBROUTINE
keyword are highlighted.
But now I want to select everything between the SUBROUTINE
keywords. I want a selection that includes everything from the start of the first SUBROUTINE
to the end of the second SUBROUTINE
. I prefer this be done in language agnostic manner, because I can imagine circumstances like this might occur in other contexts and I don't want to bother accumulating muscle memory for something that only works in Fortran.
Is there a command in sublime to select all text that occurs between the start and end positions of a multicursor selection?
Quick Add Next. To add the next occurrence of the current word to the selection, use Quick Add Next, which is bound to Ctrl+D on Windows and Linux, or Command+D on OS X. Again, if you go too far, use Undo Selection (Ctrl+U, or Command+U on OS X) to step backwards.
To move to the start or end of the document, press Ctrl+Home or Ctrl+End. To select everything from the current position of the text cursor to the start or end, press Shift+Ctrl+Home or Shift+Ctrl+End. To jump to the next or previous word, hold down the Ctrl key while pressing the left or right arrow keys.
There's a group of commands in sublime that approximate this behavior. They're exposed through the CTRL+K combo keys:
Search for the first result, call set_mark, search for the second, call select_to_mark.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With