[Vim-latex-cvs] vimfiles/plugin SyntaxFolds.vim,1.1.1.1,1.2
Brought to you by:
srinathava,
tmaas
From: <sri...@us...> - 2002-11-02 02:56:59
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory usw-pr-cvs1:/tmp/cvs-serv26955 Modified Files: SyntaxFolds.vim Log Message: . adding explanations of how to add a syntax fold item. Index: SyntaxFolds.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/SyntaxFolds.vim,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SyntaxFolds.vim 30 Apr 2002 00:03:26 -0000 1.1.1.1 --- SyntaxFolds.vim 2 Nov 2002 02:56:55 -0000 1.2 *************** *** 3,6 **** --- 3,7 ---- " Author: Srinath Avadhanula " ( sr...@fa... ) + " Last Change: Sun Oct 27 01:00 AM 2002 PST " Description: Emulation of the syntax folding capability of vim using manual " folding *************** *** 27,38 **** " the section is assumed to end 1 line _before_ another section " starts. ! " Example: A syntax fold region for a latex section is ! " startpat = "\\section{" ! " endpat = "\\section{" ! " startoff = 0 ! " endoff = -1 " Note that the start and end patterns are thus the same and endoff has a " negative value to capture the effect of a section ending one line before " the next starts. " " Each time a call is made to FoldRegions(), all the regions (which might be --- 28,84 ---- " the section is assumed to end 1 line _before_ another section " starts. ! " startskip: a pattern which defines the beginning of a "skipped" region. ! " ! " For example, suppose we define a \itemize fold as follows: ! " startpat = '^\s*\\item', ! " endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', ! " startoff = 0, ! " endoff = -1 ! " ! " This defines a fold which starts with a line beginning with an ! " \item and ending one line before a line beginning with an ! " \item or \end{enumerate} etc. ! " ! " Then, as long as \item's are not nested things are fine. ! " However, once items begin to nest, the fold started by one ! " \item can end because of an \item in an \itemize ! " environment within this \item. i.e, the following can happen: ! " ! " \begin{itemize} ! " \item Some text <------- fold will start here ! " This item will contain a nested item ! " \begin{itemize} <----- fold will end here because next line contains \item... ! " \item Hello ! " \end{itemize} <----- ... instead of here. ! " \item Next item of the parent itemize ! " \end{itemize} ! " ! " Therefore, in order to completely define a folding item which ! " allows nesting, we need to also define a "skip" pattern. ! " startskip and end skip do that. ! " Leave '' when there is no nesting. ! " endskip: the pattern which defines the end of the "skip" pattern for ! " nested folds. ! " ! " Example: ! " 1. A syntax fold region for a latex section is ! " startpat = "\\section{" ! " endpat = "\\section{" ! " startoff = 0 ! " endoff = -1 ! " startskip = '' ! " endskip = '' " Note that the start and end patterns are thus the same and endoff has a " negative value to capture the effect of a section ending one line before " the next starts. + " 2. A syntax fold region for the \itemize environment is: + " startpat = '^\s*\\item', + " endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', + " startoff = 0, + " endoff = -1, + " startskip = '^\s*\\begin{\(enumerate\|itemize\|description\)}', + " endskip = '^\s*\\end{\(enumerate\|itemize\|description\)}' + " Note the use of startskip and endskip to allow nesting. + " " " Each time a call is made to FoldRegions(), all the regions (which might be |