Fandom

Vim Tips Wiki

Fold a C sharp region

Redirected from VimTip1321

1,624pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

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.


Also on Fandom

Random Wiki