Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xi/vim-indent-folding
https://github.com/xi/vim-indent-folding
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/xi/vim-indent-folding
- Owner: xi
- License: mit
- Created: 2013-11-30T23:41:56.000Z (about 11 years ago)
- Default Branch: main
- Last Pushed: 2024-08-24T18:23:25.000Z (5 months ago)
- Last Synced: 2024-08-24T19:35:05.747Z (5 months ago)
- Language: Vim Script
- 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.2Vim'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`).