1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-04 23:58:01 +00:00

Add Switch Moving End Of Visual Selection as a Vim TIL

This commit is contained in:
jbranchaud
2024-10-14 20:20:41 -05:00
parent 567637497c
commit 4d1d8e7134
2 changed files with 19 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
# Switch Moving End Of Visual Selection
When I go into character-wise visual selection mode, one end of the visual
selection is fixed while I move my cursor around to define the other end of it.
Let's say I've arranged a visual selection that encompasses several lines of my
file. And then I realize that the fixed front-end of my visual selection is off
by a bit. Maybe I've selected an entire function definition and I just want to
inner part of the function.
Instead of starting over with my visual selection. I can leave the right-end of
the visual selection where it is, hit `o` which will switch the moving end to
the other side, and then continue making adjustments from there.
I can always hit `o` again to switch it back to the original side.
See `:h v_o` for more details.