vim-anyfold : Generic folding mechanism and motion based on indentation
script karma |
Rating 0/0,
Downloaded by 2004 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Patrick Seewald |
|
script type |
indent |
|
description |
For examples and full documentation, visit the official repository
https://github.com/pseewald/vim-anyfold
This plugin comes with the following features:
* Folding mechanism based on indented blocks that has a very intuitive and predictable behaviour.
* Results comparable to syntax aware folding methods but fast and generic algorithm that does not rely on language specific rules.
* Works out of the box for any filetypes, optimal results for all indented languages (including properly indented curly brace languages).
* Shortcuts to navigate to beginning / end of a block and to previous / next indented block.
* Can handle corner cases with ease (comments, varying indentation widths, line breaks).
* Fast update mechanism that keeps folds in sync with buffer.
It has the following shortcomings:
* Can not correctly fold mismatched indentation and thus should only be used together with disciplined programming style (or in combination with Vim's equalprg autoindent feature).
Setup and Usage:
1. Install this plugin with a vim plugin manager.
2. Add the following lines to your vimrc (if not already present).
filetype plugin indent on
syntax on
let anyfold_activate=1
set foldlevel=0
Choose a higher foldlevel if you prefer to have folds open by default.
3. Use Vim's fold commands zo, zO, zc, za, ... to fold / unfold folds (read :h fold-commands for more information). Use key combinations [[ and ]] to navigate to the beginning and end of the current open fold. Use ]k and [j to navigate to the end of the previous block and to the beginning of the next block. |
|
install details |
Install this plugin with your preferred vim plugin manager. |
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 35.170.81.33
|