Sublime Forum

Is there a human-friendly document that details selections?

#1

The documentation for selections at sublimetext.com/docs/selection is rather anemic and relying on trial and error is like trying to decipher ancient runes. :open_mouth: What I’d like to see or help write for new users like myself is a readable document in plain English that shows us how to do all the cool selections strewn about in these forums.

For instance, how do we:

  • Select all code in a tag, function, etc
  • Select all instances of variables or identifiers in a document and have changes reflect in all instances
  • Select asymmetrical columns that don’t have the same ending points
  • Search and select within a selection

And many more. It would be great if the document was organized such:

  1. Name and show the selection in action (if possible) in plain English
  2. Give a brief description of what it does
  3. List the keystrokes to make it happen
  4. List the keybindings for more advanced users who want to go in and toggle stuff
  5. If dependent on a plugin, point to a link of that plugin so we can easily grab it and get working
  6. Show cool uses of pairing different plugins or selections together like a combo attack in Street Fighter 2 :smile:

So far I’ve been depending on trial and error, piecemeal forum posts, plugins that lack clear, accessible instructions, and screencasts with no idea of what keystrokes are being pressed to achieve those effects I so badly want to use!

Any help is greatly appreciated and I absolutely wouldn’t mind putting together a document if steered in the right direction.

Holler at your boy!

0 Likes

#2

I’ll try to help the best I can.

  1. You can easily do this with find all. Hit ctrl F, type your string (feel free to use regex etc), and hit find all. All matches are now selected and you can change them all at once by typing. At this point you could just do a find & replace just the same though. (forgot the keybind, I rebound it)

You can also use ctrl + d. Ctrl + d highlights whatever word the caret is currently in if it is. Further presses will continue to highlight the next place in the file that is identical to what’s already selected. It will loop to the end and start back from the beginning and highlight more if for instance you started in the middle. You can also use ctrl + d with any other selection. So you can highlight a line of code and hit ctrl + d to quickly select any other instance that exact line is found.

There is also an option to specify what characters separate words that obviously effects this functionality. You can configure how you wish.

  1. Ctrl + left click let you add new carets. You can select lines anything etc just as you normally would just hold ctrl and drag and highlight everything you want. Shift + right click will let you select columns. You can combine this with ctrl (so ctrl + shift + right click) as well to add multiple column selections and mix & match with normal selections.

  2. In the find and find & replace panels there is a box to click that will search in selections. I think it is automatically on if you open the panel with a selection though I’m not 100% sure and it may act differently with the copy text to find panel option on. There may also be a key bind for it, some of the options have keybinds. If there isn’t I’m sure you can probably bind it if you want.

That’s all I can think of at the moment. Not sure about your first question. There are some other default keybinds for selections that I haven’t really messed with, sure of their use, have had varying success using. There is also a plugin I believe somewhere that allows you to do multiple selections with just the keyboard. I think it’s the power user plugin though I’m not sure.

Lastly, I think it was Subliminator, started writing a beginner’s guide to Sublime that had a decent section on using selections (it also has a lot of other useful information). It’s probably a few pages back in this forum.

0 Likes

#3

Here’s a link to Sublimator’s docs on selections:
http://sublime.akalias.net/gettingstarted/concepts-multiple-selections.html

0 Likes

#4

Anomareh: Thanks for your contribution but I’m looking for selections that are a bit more advanced! Since we’re both new, maybe send me a PM as you find out new stuff that might be documented elsewhere and I’ll do the same :smile:

n00ge: That’s exactly what I was looking for. Thank you kindly! I’m sure I’ll have more questions after reading it and messing around but the questions will be more specific!

0 Likes