notepad++ user defined regions with folding

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

How do I delete specific lines in Notepad++?

Notepad++ v6.5 Search menu -> Find… -> Mark tab -> Find what: your search text, check Bookmark Line, then Mark All. This will bookmark all the lines with the search term, you’ll see the blue circles in the margin. Then Search menu -> Bookmark -> Remove Bookmarked Lines. This will delete all the bookmarked lines. … Read more

How do you run a python script from within notepad++? [duplicate]

Plugins NppExec Execute (F6) is much more powerful than plain Run (F5). Install NppExec via Plugins, Plugin Manager. Then in F6 add/save the following: NPP_SAVE cd “$(FULL_CURRENT_PATH)” C:\Python34\python.exe -u “$(FULL_CURRENT_PATH)” In Plugins NppExec Console output filters (Shift+F6) add the following HighLight mask: *File “%FILE%”, line %LINE% Make sure it’s checked, and make it e.g. red … Read more

Delete all content but keeping matched

You may use the following regex: (?i-s)[0-9]([a-z])|. Replace with (?{1}$1:). To delete all but non-matched, use the (?{1}$0:) replacement with the same regex. Details: (?i-s) – an inline modifier turning on case insensitive mode and turning off the DOTALL mode (. does not match a newline) [0-9]([a-z]) – an ASCII digit and any ASCII letter … Read more

Notepad++ Find/Replace number with Increment Value

It is not possible with just a regex, but you can use a python script inside Notepad++. Here are the steps: Install Python Script 1.0.8.0 Go to the Plugins -> Python Script -> New Script Select the file name (say, “increment_numbers.py”) Place this script there: Code: def increment_after_openparen(match): return “({0}”.format(str(int(match.group(1))+31)) editor.rereplace(r’\((\d+)’, increment_after_openparen) Then, just evoke … Read more