So maybe this already exists, maybe it doesn’t. Unless I’m missing something big, it’s not a default option in most of the IDEs/editors I use. By default when selecting a string, whether it’s a variable/class/whatever you’ll have a segment of the string selected only if it’s been segmented by dashes. This means that double-clicking on a piece of a string such as say:
Will select this:
Which is awesome if you’re using a language/coding style that uses these kinds of strings as names. Things start to suck when you’re using underscores though, as far as I know it’s only possible to select the entire string. This is a bit of a waste of time since now instead of selecting a much needed segment you’ll get something like this:
What I want is selective selection: have the entire string selected by default or if a certain key is pressed then just select a segment. This would mean double clicking on like so:
This doesn’t apply to just underscores either, I’d want to see this feature for camelCase as well:
And in case your’re wondering why this is would be useful:
- quickly renaming incorrect typeahead completions (NSMutableString ->NString)
- qickly remaming strings (span4 -> span8)
- quickly replacing multiple segments when doing things like copying methods
- quickly copying segments that need to be used elsewhere (setActiveSession -> activeSession)
- … and many more scenarios that don’t immediately come to mind.
I’d want to test drive something like this in Sublime2 if I gave plugin development a second chance (Urg Python). If there’s anything like this out already then by all means please let me know.
edit: so many typos!