vault backup: 2025-03-21 10:22:00
This commit is contained in:
parent
213e3fd91e
commit
8f487e47ba
4
.obsidian/plugins/colored-tags/data.json
vendored
4
.obsidian/plugins/colored-tags/data.json
vendored
@ -207,7 +207,9 @@
|
||||
"Neo": 195,
|
||||
"subtask": 196,
|
||||
"Personal": 197,
|
||||
"MARVEL": 198
|
||||
"MARVEL": 198,
|
||||
"Vim": 199,
|
||||
"Learning": 200
|
||||
},
|
||||
"_version": 3
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
---
|
||||
date: 2025-03-21
|
||||
tags:
|
||||
- Vim
|
||||
- Learning
|
||||
---
|
||||
#Vim #Learning
|
||||
# What is code folding?
|
||||
Code folding is when you can take several lines of code and collapse them.
|
||||
Folding is super useful for situations where code takes up space when you
|
||||
do not need to see it for your current editing. Common cases are things
|
||||
like function definitions, for loops, or large tables.
|
||||
|
||||
# How does Vim handle folding?
|
||||
## Folding Modes
|
||||
|
||||
Vim has several folding modes:
|
||||
1. `manual` - you pick where folds go
|
||||
2. `indent` - fold by indented blocks
|
||||
3. `syntax` - fold by semantic markers in code
|
||||
4. `expr` - fold by user expression
|
||||
5. `marker` - fold based on [[Markers]] that are placed by a user
|
||||
6. `diff` - used to fold unchanged text when using [[Views]]
|
||||
|
||||
For the most part, I'm just going to use manual mode. I know enough of the
|
||||
motions that I can get around easier, and plus since I write in a variety
|
||||
of languages things like indent or syntax might not be sufficient or
|
||||
expressive enough.
|
||||
|
||||
## Folding Commands
|
||||
To create a fold, use `zf{motion}`, where, you guessed it, you can use
|
||||
just about any of the [[Motions]] you like.
|
||||
|
||||
Folds can also be created using Visual mode. Select the text, then `zf`.
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user