Visual + Ex Range
Pressing : from Visual auto-fills the range.
When you press : while in Visual mode, Vim drops you to the command line with :'<,'> already typed โ the range covering the selection. Just type your command after.
Visual mode and Ex commands plug right into each other. Press : from any Visual selection and Vim pre-types the range.
| Key | Note |
|---|---|
| V | Line Visual |
| 5j | Extend down 5 lines |
| : | Vim shows :'<,'> |
| s/foo/bar/g | Operate on those lines only |
Watch
- ๐บ #0443 Block Insert (not yet published)
- ๐บ #0443 Block Insert (not yet published)
See also: Ex Ranges, Substitute ({key::s}), Special Marks