History Report a problem
Article Edit this page Discussion

Fold a C sharp region

From Vim Tips Wiki

Jump to: navigation, search

Tip 1321 Previous TipNext Tip

Created: September 7, 2006 Complexity: basic Author: John Cena Minimum version: n/a Karma: 16/6 Imported from: Tip#1321


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.

[edit] References

[edit] Comments

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


Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto
Pushing Daisies
Legend of Zelda Wiki
Terminator Wiki
Everquest II Wiki
Godzilla
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions
Send this article to a friend
"Fold a C sharp region"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation


.