StringManipulation
StringManipulation copied to clipboard
Multi Caret "Select until.."
Often times I have strings that are not the same length that I need to select until a certain character per line. Using IntelliJ's default tools, and even with some plugins, it's not always achievable.
Say you have this multi-caret in your text editor, where | is the multi caret:
|test-test.test |test-test-test.test |test-test-test-test-test.test |test-test-test-test-test-test.test
How do you achieve this selection where [] are the selection boundaries?
[test-test].test [test-test-test].test [test-test-test-test-test].test [test-test-test-test-test-test].test
This is a VERY simple use case, the ones I deal with are far more complex.
Rules: 1.) Must only work with the carets already existing. 2.) You can't cheat this by going to the end of each line and working backwards because the end of each line has the same number of words/characters. 3.) Can't select all instances of period and work back.
Also, yes you can also use a regex search within selection, but I am looking for push button solution that requires minimal if not zero setup or complexity.
One solution would be a multi character supported "select until" function or popup where you type in the character after executing the command and it looks forwards or backwards for your query.
Sublime text has an addon that does just this: https://github.com/xavi-/sublime-selectuntil
sounds nice
As much as I would like this to be in Missing In Actions (as well as it makes sense to be there), it is never going to happen sadly. The best hope for this idea is in this project. :) @krasa
Just fyi, that example is easily achievable with IntelliJ's default functionality:
- Place your multiline caret
- Hold
<shift>
while pressing<end>
to select every line to the end - Keep holding
<shift>
and hold<ctrl>
while using the arrow keys to select/deselect entire words
in this case yes, in other more random inputs no.