Fold functionality will be useful when file contents large text. Using this feature we can only show selected potion of file. This feature is particularly useful while working with programming languages. In this chapter, we will discuss following items −
To activate fold use following command −
:set foldenable :set foldmethod = indent
To deactivate fold use following command
:set nofoldenable
To fold code, go to any method and execute following command −
zc
For example below image shows the result of this action −
To open fold use following command −
zo
Below image shows the result of this action −
To close all folds execute following command
zM
Below image shows the result of this action
To unfold all execute following −
zR
Below image shows the result of this action −