Vim Tags in Visual Mode š·
This is my 400th TIL! š
Iāll file this under āVim is endlessly composableā. Today I learned that Vim tags can be used to define a range in visual mode. Hereās how youād fold your code between two Vim tags.
Go to the first tag. If you marked it 1
, hereās how youād do that:
m1
Enter visual mode and extend to your second tag 2
:
m2
Enter command mode and fold the range:
:fold
Which automatically extends to:
:'<,'>fold
I use this in big markdown files to hide all but the thing Iām currently working on. Enjoy.
Tweet