Vim - Skipping lines in visual selection
vim
Solution
If you need to copy/yank/del multiple nonconsecutive lines you can use named registers.
You do this using several selections:
Select first portion and yank/del using `"ay`/`"ad`. This will yank/del to register `a`. You can use any letter you want.
For every next selection use uppercase register name: `"Ay`/`"Ad`, this will append selection to the register contents instead of overwriting it.
After that you paste it where you need: `"ap`. Or if you need it in system clipboard: `:let @*=@a`.
To inspect the contents of the register `a` use `:reg a`. `:reg` will show you the contents of all registers.
Problem
In visual mode, how can I select an interval of lines but skip over certain lines? For example: ``` 1 Hello 2 World 3 Foo 4 Bar ``` How can I select lines 1 and 4 without selecting lines 2 and 3? Is it even possible in Vim? Looking for using it at vifm too.