https://github.com/xi/vim-indent-folding
indentation based folding for vim
https://github.com/xi/vim-indent-folding
vim
Last synced: over 1 year ago
JSON representation
indentation based folding for vim
- Host: GitHub
- URL: https://github.com/xi/vim-indent-folding
- Owner: xi
- License: mit
- Created: 2013-11-30T23:41:56.000Z (over 12 years ago)
- Default Branch: main
- Last Pushed: 2024-08-24T18:23:25.000Z (almost 2 years ago)
- Last Synced: 2025-01-30T19:23:45.470Z (over 1 year ago)
- Topics: vim
- Language: Vim Script
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Vim has some default fold methods, one of which is indentation based. However,
it folds an indented block into a single line instead of folding it into the
line right before the block.
Consider this markdown list:
- Item 1
- Item 1.1
- Item 1.2
Vim's indent folding turnes this into:
- Item 1
+-- 2 lines: - Item 1.1-------------------------------------------------
The plugin instead turns this into:
- Item 1-----------------------------------------------------------------
This approach is inspired by http://learnvimscriptthehardway.stevelosh.com/chapters/49.html
Unfortunately, the performance of this approach is pretty bad. To mitigate
this, the foldmethod is kept at `manual` by default and only switches to `expr`
when the folds are actually used (e.g. when pressing `za`).