sponsor Vim development Vim logo Vim Book Ad

foldsearch : fold away lines that don't match a given pattern

 script karma  Rating 100/34, Downloaded by 1237    Comments, bugs, improvements  Vim wiki

created by
Markus Braun
 
script type
utility
 
description
This plugin provides commands that fold away lines that don't match a specific search pattern.  This pattern can be the word under the cursor, the last search pattern, a regular expression or spelling errors. There are also commands to change the context of the shown lines.

Commands:

:Fw [context*]
  show lines which contain the word under the cursor. Default [context] is 0.

:Fs [context*]
  show lines which contain previous search pattern. Default [context] is 0.

:Fp pattern
  show the lines that contain the regular expression. Context is 0.

:FS
  show the lines that contain spelling errors.

:Fl
  fold again with the last used pattern

:Fc [context*]
  show context lines.

:Fi
  increment context by one line.

:Fd
  decrement context by one line.

:Fe
  set modified fold options to their previous value

* context can consist of one or two numbers. A 'unsigned' number defines the context before and after the pattern. If a number has a '-' prefix, it defines only the context before the pattern. If it has a '+' prefix, it defines only the context after a pattern.

Mappings:

<Leader>fs     FoldSearch()
<Leader>fw     FoldCword()
<Leader>fl     FoldLast()
<Leader>fS     FoldSpell()
<Leader>fi     FoldContextAdd(+1)
<Leader>fd     FoldContextAdd(-1)
<Leader>fe     FoldSearchEnd()
 
install details
Copy the foldsearch.vim file to the $HOME/.vim/plugin directory. Refer to ':help add-plugin', ':help add-global-plugin' and ':help runtimepath' for more details about Vim plugins.
 

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
foldsearch.vim 2213 2008-07-26 7.0 Markus Braun - fixed a bug in context handling
foldsearch.vim 2209 2008-07-17 7.0 Markus Braun Initial upload
ip used for rating: 23.20.20.195

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.
   
SourceForge.net Logo