sponsor Vim development Vim logo Vim Book Ad

C-fold : Automates folding and unfolding C & C++ comments and code blocks.

 script karma  Rating 9/22, Downloaded by 2669  Comments, bugs, improvements  Vim wiki

created by
Neil Vice
 
script type
ftplugin
 
description
Automatically folds all blocks (i.e. { } ) in C and C++ and defines a function that performs a command e.g. zo on all folds beginning with text that matches a given pattern.

This allows for the following mappings defined by the plugin:

      z[ - Opens all doxygen-style comments
      z] - Closes all doxygen-style comments
      z{ - Opens all code blocks (i.e. {  })
      z} - Closes all code blocks
 
install details
Extract the archive from your home directory. This will extract the following files:
      .vim/plugins/cfold.vim
      .vim/after/syntax/c.vim

Also requires the folding of Doxygen-style comments. This requires vimscript #5. This can be done easily by adding the 'fold' keyword to the end of the 'doxygenComment' region in the 'doxygen.vim' syntax file:

      syn region doxygenComment start= ... keepend fold

Additional languages can be supported as appropriate (e.g. Java) by copying 'c.vim' and renaming to the syntax file for the language (e.g. java.vim).
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
cfold.tar.bz2 0.1 2004-11-30 6.0 Neil Vice Initial upload
ip used for rating: 18.216.251.37

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github