Wikia

Vim Tips Wiki

Changes: Fold a C sharp region

Edit

Back to page

(Standard category names + minor manual clean.)
(Change <tt> to <code>, perhaps also minor tweak.)
 
Line 11: Line 11:
 
|category2=Plugin
 
|category2=Plugin
 
}}
 
}}
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>

Latest revision as of 06:20, July 13, 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.

ReferencesEdit

CommentsEdit

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


Around Wikia's network

Random Wiki