PracticalVim Tip21 - yszheda/wiki GitHub Wiki

Table of Contents

Tip 21: Define a Visual Selection

Return to the top: <>

Enabling Visual Modes

| Command | Effect | | `v` | Enable character-wise Visual mode | | `V` | Enable line-wise Visual mode | | `` | Enable block-wise Visual mode | | `gv` | Reselect the last visual selection |

Switching Between Visual Modes

| Command | Effect | | ``/``]| Switch to Normal mode | | `v`/`V`/``]| Switch to Normal mode (when used from character-, line-, block-wise Visual mode, respectively) | | `v` | Switch to character-wise Visual mode | | `V` | Switch to line-wise Visual mode | | `` | Switch to block-wise Visual mode | | `o` | Go to other end of highlighted text |

Toggling the Free End of a Selection

`o`: toggle the free end

Example:

⚠️ **GitHub.com Fallback** ⚠️