How to add user defined regions with folding in Notepad++?

For version 6.5.5 and above: Under the menu “Language” there is a menuitem called “Define your language…“ In the tab “Folder & Default” is a group called “Folding in code” where you can enter an “Open”- and a “Close”-Keyword. For versions older than 6.5.5: Under the menu “View” there is a menuitem called “User-Defined Dialog…“ … Read more

Is there #Region code for HTML

This indeed depends on the IDE, just noticed today that the newest version of the free Web Essentials 2012 plugin for Visual Studio has added region support in HTML. http://visualstudiogallery.msdn.microsoft.com/07d54d12-7133-4e15-becb-6f451ea3bea6 http://vswebessentials.com/changelog <!–#region main –> <!–#endregion –>

removing #region

Just use Visual Studio’s built-in “Find and Replace” (or “Replace in Files”, which you can open by pressing Ctrl + Shift + H). To remove #region, you’ll need to enable Regular Expression matching; in the “Replace In Files” dialog, check “Use: Regular Expressions”. Then, use the following pattern: “\#region .*\n“, replacing matches with “” (the … Read more

How do I access the contents of the current region in Emacs Lisp?

As starblue says, (buffer-substring (mark) (point)) returns the contents of the region, if the mark is set. If you do not want the string properties, you can use the ‘buffer-substring-no-properties variant. However, if you’re writing an interactive command, there’s a better way to get the endpoints of the region, using the form (interactive “r”). Here’s … Read more