I think this would allow for the visual selection feature of vim to surpass the efficiency even of the mouse by providing an ability to "switch" the current terminus of the selection:
| shall represent the cursor (Vim has it operate at the left-side of the character it is on) and
[text] represents selected text, just pretend they take up zero width. The background of the space between
[ ] looks grey, and the character immediately following the
| is green):
Some |text here Some second line of text Some more text in the third line
v2j; note the
m character is included in the selection (it is highlighted by the cursor now):
Some [text here Some second line of text Some |m]ore text in the third line
Some [text here Some second line of text Some more text |i]n the third line
It is at this point that I might decide I wanted to start selecting from a different location. e.g., including the
"Some" on the first line.
I've got no choice in a typical editor/IDE. I probably would have to move my hand to the mouse, it's usually too painful to select text using traditional methods, the use of word hopping via
Ctrl and page-up/down does help somewhat, but no matter what, I've got to commit to one of my terminating points of the selection before I start the selection.
So in Vim I'd love for the ability to take my current state and bring it to this by hitting a mystery binding:
Some [|text here Some second line of text Some more text i]n the third line
Then I can just hit
<Home> (both do the same in this case where there is no leading whitespace) to turn it into
[|Some text here Some second line of text Some more text i]n the third line
Say I change my mind again, I want to adjust the other end!
[Some text here Some second line of text Some more text |i]n the third line
[Some text here Some second line of text Some more text i|n] the third line
Beautiful! I can do whatever I want next with this selection now.
So what's this mystery binding?
Also, even more potentially efficient would be a set of alternate bindings for some of the most-used movement commands to another row of keys, and these would (when in visual mode) always move the other end of the selection. So in that visual mode selection operation, if the movement keys for the other end of the selection were set to "yuio" (probably not a good choice since we kind of need
y but just bear with me) we could have typed
Hey you know what, that's not even that much of an improvement. Just gimme that X feature. :)
The perfect answers that I'm looking for:
- Hey, look up
- Hey, look at
- Hey, look at
I'm pretty new to this fascination with Vim so I am very green when it comes to Vimscript, and honestly I'd like to stay away from trying to learn yet another language, so hopefully I won't be forced to build this as a plugin.