Vim Tips Wiki
(Move categories to tip template)
(Change <tt> to <code>, perhaps also minor tweak.)
 
(2 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
|previous=1320
 
|previous=1320
 
|next=1322
 
|next=1322
|created=September 7, 2006
+
|created=2006
 
|complexity=basic
 
|complexity=basic
 
|author=John Cena
 
|author=John Cena
|version=n/a
+
|version=6.0
 
|rating=16/6
 
|rating=16/6
|category1=C_sharp
+
|category1=C sharp
 
|category2=Plugin
 
|category2=Plugin
|category3=Usage
 
 
}}
 
}}
Here is how to fold the following region by typing <tt>zf%</tt>
+
Here is how to fold the following region by typing <code>zf%</code>
   
 
<pre>
 
<pre>
Line 23: Line 22:
   
 
<pre>
 
<pre>
let b:match_words = '\s*#\s*region.*$:\s*#\s*endregion
+
let b:match_words = '\s*#\s*region.*$:\s*#\s*endregion'
 
</pre>
 
</pre>
   

Latest revision as of 06:20, 13 July 2012

Tip 1321 Printable Monobook Previous Next

created 2006 · complexity basic · author John Cena · version 6.0


Here is how to fold the following region by typing zf%

#region
...
#endregion

Just add the following line in your cs.vim file placed in syntax folder beneath your vimruntime path.

let b:match_words = '\s*#\s*region.*$:\s*#\s*endregion'

It works even if the cursor is not on the "#region" keyword.

References[]

Comments[]

And copy the "matchit.vim" file from your macros folder to plugin folder for it to automatically load everytime a window opens.