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

Add Fold A Visual Selection And Expand It Back as a vim til

This commit is contained in:
jbranchaud
2018-01-18 17:02:04 -06:00
parent bdc1f666c7
commit 663c16177b
2 changed files with 20 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
# Fold A Visual Selection And Expand It Back
If I visually select a series of lines -- say the open and close tags of a
large `div` in an HTML file I am reading through -- and then hit `zf`, it
will be _folded_ into a single line. That line will list how many lines are
included in the fold as well as the content of the first line of the fold.
If I later come back to that fold and want to expand it again, I can hit
`zd` to delete (or undo) the fold.
To do this, you'll want to make sure your `foldmethod` is set to `manual`.
This can be done by running the following command:
```
:set foldmethod=manual
```
See the vim helpfiles (`:h fold`) for more details.