Fold/Collapse/Hide Code Blocks using Vim
This page answers questions like these:
- How to fold text in vim?
- How to fold code blocks in vim?
- How to hide text in vim?
- How to hide code blocks in vim?
- How to collapse text in vim?
- How to collapse code blocks in vim?
- How to contract text in vim?
- How to contract code blocks in vim?
Related Links:
Expand/Show/Open Collapsed/Hidden/Folded Text in Vim
Find Surrounding Code Block in Vim
Replace with Confirmation in Vim
Write Lines to Another File in Vim/Vi
E432: Tags file not sorted: tags | E257: cstag: tag not found | E426: tag not found:
How to Fold/Collapse/Hide a Code Block in Vim:
- If the cursor is somewhere on or inside a {} block, type “va{zf” or equivalently “va}zf”.
- If the cursor is somewhere on or inside a [] block, type “va[zf” or equivalently “va]zf”.
- If the cursor is somewhere on or inside a () block, type “va(zf” or equivalently “va)zf”.
- If the cursor is on the {, }, [, ], (, or ) character, type “zf%”.
How to Fold/Collapse/Hide Some Arbitrary Text in Vim:
- To fold text from the current line to some subsequent line containing a PATTERN, type “zf/PATTERN” then press the “Enter” key.
- To fold text from the current line to some previous line containing a PATTERN, type “zf?PATTERN” then press the “Enter” key.
Related Links:
Expand/Show/Open Collapsed/Hidden/Folded Text in Vim
Find Surrounding Code Block in Vim
Replace with Confirmation in Vim
Write Lines to Another File in Vim/Vi
E432: Tags file not sorted: tags | E257: cstag: tag not found | E426: tag not found:
Home > Vim > Fold/Collapse/Hide Code Blocks using Vim
Tags: fold block, collapse block, hide code block, contract, compress, code, vim
Copyright © HelpDoco.com
vim-fold-text.txt
Vim/fold-collapse-hide-text-code-blocks-using-vim.htm
2