This is a repository for some of my varied snippets on Notepad++ knowledge. (If bluehost's mojomarketplace was more user friendly for "playing with" an install, then deleting it again, I might have played with their wiki choices until I found one to my liking... but since I couldn't uninstall it through the interface (I ended up just deleting the subdir it created), I decided simpler was better.
most of these snippets are presented in their raw Markdown, for easy pasting into the Notepad++ forums.
Here are various snippets to paste in the forums when helping others with specific topics. (Should probably get its own page, eventually.)
\---
_moderator added code markdown around text; please don't forget to [use the `</>` button to mark example text as "code"](https://community.notepad-plus-plus.org/topic/21925/faq-desk-formatting-forum-posts) so that characters don't get changed by the forum_
It appears that you want DirectWrite enabled; see [Settings > Preferences > MISC](https://npp-user-manual.org/docs/preferences/#misc:~:text=DirectWrite%20will%20help%20in%20displaying%20characters). As the Preferences dialog says, turning it on "may improve rendering special characters".
[FAQ Desk](https://community.notepad-plus-plus.org/category/7/faq)
["FAQ: What is `%AppData%`"](https://community.notepad-plus-plus.org/topic/15740/faq-desk-what-is-appdata)
[🛈](https://community.notepad-plus-plus.org/topic/15740/faq-desk-what-is-appdata "FAQ: What is %AppData%?")
["FAQ: Feature Request"](https://community.notepad-plus-plus.org/topic/15741/faq-desk-feature-request-or-bug-report)
["FAQ: Bug Report"](https://community.notepad-plus-plus.org/topic/15741/faq-desk-feature-request-or-bug-report)
["FAQ: Periodic Backup vs. AutoSave Plugin"](https://community.notepad-plus-plus.org/topic/21782/faq-desk-periodic-backup-vs-autosave-plugin)
Your comment is not specific to this release.
The "vX.Y.Z Release" topics like this one are specific to changes made in one release: comments here should focus on a feature that was added or intentionally changed in this version, or on a "regression" (something that used to work broke due to a change in this version)
If you have a general question about Notepad++ that isn't specific to this version, please post in [Help Wanted](https://community.notepad-plus-plus.org/category/4/help-wanted)
If you have a general feature request, we have a ["Feature Request FAQ"](https://community.notepad-plus-plus.org/topic/15741/faq-desk-feature-request-or-bug-report)
You can add extra highlighting to a builtin lexer (like the HTML lexer) or to a User Defined Language (UDL) using regexes via the [EnhanceAnyLexer plugin](https://github.com/Ekopalypse/EnhanceAnyLexer/): download the [latest here](https://github.com/Ekopalypse/EnhanceAnyLexer/releases/latest).
\---
*Notepad++ Documentation: check the official docs at npp-user-manual.org. If something is missing or wrong there, see if it's been fixed in the [repository](https://github.com/notepad-plus-plus/npp-usermanual/) already, but hasn't been released to the website yet. If it's not there, feel free to [create an issue](https://github.com/notepad-plus-plus/npp-usermanual/issues/) and wait patiently for it to be improved and released.*
\----
### Useful References * [Please Read Before Posting](https://community.notepad-plus-plus.org/topic/21965/please-read-before-posting) * [Template for Search/Replace Questions](https://community.notepad-plus-plus.org/topic/22022/template-for-search-replace-questions) * [Formatting Forum Posts](https://community.notepad-plus-plus.org/topic/21925/faq-desk-formatting-forum-posts) * [Notepad++ Online User Manual: Searching/Regex](https://npp-user-manual.org/docs/searching/#regular-expressions) * [FAQ: Where to find other regular expressions (regex) documentation](https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regular-expressions-regex-documentation)
\----
_**Please note**: This Community Forum is not a data transformation service; you should not expect to be able to always say "I have data like X and want it to look like Y" and have us do all the work for you. If you are new to the Forum, and new to regular expressions, we will often give help on the first one or two data-transformation questions, especially if they are well-asked and you show a willingness to learn; and we will point you to the documentation where you can learn how to do the data transformations for yourself in the future. But if you repeatedly ask us to do your work for you, you will find that the patience of usually-helpful Community members wears thin. The best way to learn regular expressions is by experimenting with them yourself, and getting a feel for how they work; having us spoon-feed you the answers without you putting in the effort doesn't help you in the long term and is uninteresting and annoying for us._
\----
_**Please note**: This Community Forum is not a data transformation or free-code-writing service; you should not expect to be able to always say "I have data like X and want it to look like Y" and have us do all the work for you. If you are new to the Forum, and the problem can be easily solved with a regular expression, we'll likely give you a start on that. And if it requires scripting (more complex logic than can easily be done in a regular expression), we will let you know. If your problem catches the interest of one of the regulars, that person may even provide an example script that may be helpful; often times, we might even ask you to search the forum for a particular term, because that term will likely help you find a script that already implements something similar. Whether it's a previously-written script, or whether one of us hacks something up for you specifically, it won't always exactly match your problem, but it's at least a starting point for you to work from. At that point, you are expected to take the lead, and make any changes to the example that are necessary to convert it from what was provided to something that meets you exact needs. This forum is focused on Notepad++; while you may _want_ to use Notepad++ for the implementation, text editors aren't always the right tool for complex text transformation tasks: since you are seeing this boilerplate in my reply, it means that I believe that it's essentially a generic programming challenge, which is off topic for a Notepad++\-specific forum._
Sorry. I could not reproduce it. It works for me.
\----
*Why such a short reply? Because you didn't tell us enough to be able to reproduce your problem, or because I tried what you described and got the results I expected. If you [give us more information](/topic/15739/faq-desk-request-for-help-without-sufficient-information-to-help-you), we might be able to help more. Especially important are the **?** menu's **Debug Info** contents, a thorough description of the steps necessary to reproduce your problem, example text highlighted using the `</>` button or [Markdown syntax](/topic/21925/faq-formatting-forum-posts), and possibly a screenshot of the problem (if you think it will help clarify the problem; use Windows' **Snip & Sketch** or `Alt+PrtScrn` to capture the image, and `Ctrl+V` to paste it in your post).*

Per the "[Dail Critereon](https://community.notepad-plus-plus.org/post/53507)", all I should say is ...
* Special Characters: * Checkboxes: `☐ ☑ ☒ ✓ ✗ ◯ ○ 🔘 ⊙ ⦾ ⦿` -- where the last is my favorite (but doesn't always render in NPP) especially useful for saying whether to ☑ Enable or ☐ Disable a checkbox in a dialog box * [Arrows](http://www.fileformat.info/info/unicode/block/arrows/utf8test.htm) or [compart](https://www.compart.com/en/unicode/block/U+2190): * Standard Arrows: `← ↑ → ↓ ↔ ↕ ⇐ ⇑ ⇒ ⇓ ⇔ ⇕` * Circle Arrows: `↶ ↷ ↺ ↻ ⟲ ⟳ ⭮ ⭯` * Other Arrow-like Characters: `▲ ▶ ▼ ◀ 〈 〉 ﹀ ︿ 《 》 ︽ ︾` * [Wikipedia:Arrows (Unicode block)](https://en.wikipedia.org/wiki/Arrows_(Unicode_block)) * Angles: ΘΦΨ (upper) θφψ (lower) ° (degrees) ∠ (angle) ∟ (right angle) ⟂ (perpendicular) * Products: dot:⋅ bigdot:∙ cross:× star:⋆ * Other Math: plusminus: ± minusplus: ∓ roots: √ ∛ ∜ * [CompArt: Math Symbols [Sm]](https://www.compart.com/en/unicode/category/Sm) * [Operators](https://www.fileformat.info/info/unicode/block/mathematical_operators/utf8test.htm) or [Compart version](https://www.compart.com/en/unicode/block/U+2200) * [Unicode Computing Symbols](http://xahlee.info/comp/unicode_computing_symbols.html): * Control Key: choose your favorite: * `^` `U+005E` CIRCUMFLEX (ASCII) (standard practice) * `✲` `U+2732` OPEN CENTRE ASTERISK * `⎈` `U+2388` HELM [](https://i.imgur.com/0Mon4gO.png) * Windows Key: * `❖` `U+2756` BLACK DIAMOND MINUS WHITE X [](https://upload.wikimedia.org/wikipedia/commons/thumb/3/3c/Touche_Windows_8_10.jpg/120px-Touche_Windows_8_10.jpg) * Apple Command Key: * `⌘` `U+2318` PLACE OF INTEREST * `🍎` `U+1F34E` RED APPLE * `🍏` `U+1F34F` GREEN APPLE [](https://upload.wikimedia.org/wikipedia/commons/thumb/4/40/Apple_key.jpg/60px-Apple_key.jpg) * Menu Key: these all have the same rectangle-with-horizontal-lines that shows up on the "menu / right click" key * `≣` `U+2263` STRICTLY EQUIVALENT TO * `≡` `U+2661` IDENTICAL TO * `☰` `U+2630` Chinese TRIGRAM FOR HEAVEN * `▤` `U+25A4` SQUARE WITH HORIZONTAL FILL [](https://upload.wikimedia.org/wikipedia/commons/thumb/1/1d/Kontextmen%C3%BC.jpg/120px-Kontextmen%C3%BC.jpg) * Lots more; explore that page * These symbols can be used when typing key combinations, such as `^C` for "control C" or `❖R` for `windows-key R`. Though usually, I just end up using `Ctrl+C`, `Alt+C`, `WIN+R` or similar * Footnotes/Links: * `🔗` `U+1F517` LINK SYMBOL * `⛓` `U+26D3` CHAINS * `↗` `U+2197` NORTH EAST ARROW * `↱` `U+21B1` UPWARDS ARROW WITH TIP RIGHTWARDS * `°` `U+00B0` DEGREE SIGN * `⁰` `U+2070` SUPERSCRIPT ZERO * `¹` `U+00B9` SUPERSCRIPT ONE * `²` `U+00B2` SUPERSCRIPT TWO * `³` `U+00B3` SUPERSCRIPT THREE * `ⁿ` `U+207F` SUPERSCRIPT LATIN SMALL LETTER N * `†` `U+2020` DAGGER * `‡` `U+2021` DOUBLE DAGGER * `🛈` `U+1F6C8` CIRCLED INFORMATION SOURCE * [Unicode Superscripts and Subscripts Block](https://www.fileformat.info/info/unicode/block/superscripts_and_subscripts/utf8test.htm) * `⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾ⁿⁱ` Superscripts * `₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎` Subscript Numeric * `ₐₑₒₓₔₕₖₗₘₙₚₛₜ` Subscript Alpha * `ᵢᵣᵤᵥᵦᵧᵨᵩᵪ` [Phonetics](https://www.fileformat.info/info/unicode/block/phonetic_extensions/utf8test.htm) * Smileys: * ☺ `U+2640` SMILE `:-)` `:)` * ☹ `U+2639` FROWN `:-(` `:(` * 😃 `U+1F603` OPEN `:-D` `:D` * 😉 `U+1F609` WINK `;-)` `;)` * 😐 `U+1F610` NEUTRAL `:-|` `:|` * 😜 `U+1F61C` TongueOut `:-p` `:p` * 😲 `U+1F632` ASTONISHED `:-o` `:o`
* Embedded images: * syntax: `` * `\usr\local\scripts\dataURL.pl filename.png` for _small_ files * pryrt2 @ IMGUR: login with G+ using @Work email * [https://pryrt2.imgur.com/all/](https://pryrt2.imgur.com/all/) * Scripting Plugins * External (not a plugin): [Win32::Mechanize::NotepadPlusPlus](https://metacpan.org/pod/Win32::Mechanize::NotepadPlusPlus) aka "PerlScript" * PythonScript * [PythonScript](https://github.com/bruderstein/PythonScript/) * HELP = `Plugins > Python Script > Context-Help` * [Getting Started with Python](https://www.python.org/about/gettingstarted/) * LuaScript * [LuaScript](https://github.com/dail8859/LuaScript) * [LuaScript DOWNLOAD](https://github.com/dail8859/LuaScript/releases) * jN: JavaScript for Notepad++ * [jN WIKI](https://github.com/sieukrem/jn-npp-plugin/wiki) * [jN DOWNLOAD](https://github.com/sieukrem/jn-npp-plugin/releases) * [NppExec](http://downloads.sourceforge.net/project/npp-plugins/) * [Download old-style Plugin Manager](https://github.com/bruderstein/nppPluginManager/releases) * Coming Soon: [builtin Plugin Admin](https://community.notepad-plus-plus.org/topic/16494/new-built-in-plugin-admin-plugin-manager-is-ready) * [UDL2.1 Documentation](http://ivan-radic.github.io/udl-documentation/) * Request to update doc link: [issue 2713](https://github.com/notepad-plus-plus/notepad-plus-plus/issues/2713) * Markdown * [Offical Syntax](https://daringfireball.net/projects/markdown/syntax) * [Quick Version of my PreviewHTML -> Markdown](https://community.notepad-plus-plus.org/topic/12759/plugin-to-let-you-preview-bbcode/2) * [Long Version](https://community.notepad-plus-plus.org/topic/10957/looking-for-markdown-plugin/5) * [Potential new plugin to try](https://community.notepad-plus-plus.org/topic/13212/new-plugin-markdownviewer) * Regular Expressions * [Boost Perl5-like RegExp Documentation](http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html) and [boost replace syntax](http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html) * [perldoc perlre](http://perldoc.perl.org/perlre.html) * Perl * [PM: Notepad++ Integrated Perl Debugging](https://perlmonks.org/?node_id=1137488) * ooh, the same guy who did that, did some more -- including a Python debugger using similar techniques, and making Notepad++ into more of an IDE: [Vin's Notepad++ IDE desc](http://vinsworldcom.blogspot.com/2015/08/for-notepad.html), and he has his example N++ plugin using a simple gmake makefile (gmake, like dmake, comes with strawberry perl's gcc) => [nppColHighLight](https://github.com/vinsworldcom/nppColHighlight) * [My markdown/perl combo](https://community.notepad-plus-plus.org/topic/10957/looking-for-markdown-plugin/5) * [ScreenToGif](http://www.screentogif.com/) = Animated Screen Capture to GIF (free, no ads) * finally found it by google advanced search: "animated site:https://community.notepad-plus-plus.org/" * => [@Dail's post](https://community.notepad-plus-plus.org/topic/13653/new-plugin-bettermultiselection) * => download the image, look for text, and saw "Made with ScreenToGif" at end * @Scott+Sumner also [mentioned](https://community.notepad-plus-plus.org/topic/14262/how-to-markdown-code-on-this-forum/6) SnagIt, followed by [video-to-gif](https://ezgif.com/video-to-gif) * @Claudia-Frank's PythonLexer: my collection of links to her effort is at [https://community.notepad-plus-plus.org/topic/16164/bug-javascript-multiline-character-not-understood-by-notepad/11](https://community.notepad-plus-plus.org/topic/16164/bug-javascript-multiline-character-not-understood-by-notepad/11) * @guy038: [conditional search/replace](https://community.notepad-plus-plus.org/topic/17005/how-to-change-convert-the-format-of-a-timestamp/35): use an alternation in the search `(?:(cond1)|(cond2)|(cond3)` and `(?{#}IFTRUE:ELSEFALSE)`, where `?{#}` refers to the correct index # of numbered groups from the match.
What's 64-bit ready, and what's stuck at 32-bit?
* ☑ NPP <https://notepad-plus-plus.org/download/> * ☑ NppExec 0.5.3 2015-03-04 (https://sourceforge.net/projects/npp-plugins/files/NppExec/) (however, 0.6 is under alpha, and is presumably working on a 64bit) * per <https://sourceforge.net/p/npp-plugins/discussion/672146/thread/6ca78e8a/>, there is a 20160628 build 5.9.9dev, and on 20170320, it was updated (with the same 2016-dated name) to have a 64bit version -> this one is available in the x64.PluginManager * ☒ PreviewHTML 1.3.1.0 2013-07-14 <http://fossil.2of4.net/npp_preview/home> * <http://fossil.2of4.net/npp_preview/tktview?name=240f1abc07> claims there's a test version, just not ready for primetime yet. * Work happens occasion (most recent 2018-11-03), but still no release. * Alternative: I wrote up PythonScript scripts as [⇉📺⇉ pyscFilteredViewer](https://github.com/pryrt/pyscFilteredViewer) * ☑ ComparePlugin v2.0.0 (as of 2019-01-23) is 64-bit * was: 1.5.6 2010-06-08 <https://github.com/bruderstein/PythonScript/releases> * ☑ PythonScript 1.3.0 2018-10-09 <http://sourceforge.net/projects/npppythonscript/> * ☑ NppFTP 0.26.8 <https://github.com/ashkulz/NppFTP/> * ☒ DBGP 0.13b 2012-08-25 <https://sourceforge.net/projects/npp-plugins/files/DBGP%20Plugin/> * I almost never used it anyway, so just live without it * ☑ PluginManager <https://github.com/bruderstein/nppPluginManager/releases> * SaveAsAdmin plugin: @chcg cloned to an x64 version [see thread](https://community.notepad-plus-plus.org/topic/15150/incorporating-saveasadmin-s-handling-into-n-s)
I have actually switched over to a portable x64 version in my path
Some day, I might want to build a custom lexer, or other Notepad++ plugin. These are links I've gathered that may or may not help me with that.
* Oh, awesome. I found that VinsWorldCom had a [plugin on github](https://github.com/vinsworldcom/nppColHighlight) that's compiled using perl's gmake with a Makefile! Yes, something I'll be able to learn from! * [Post:Duplicate built-in language](https://community.notepad-plus-plus.org/topic/13377/duplicate-built-in-language) links to the VB Lexer... * register using LexerModule lmVB(SCLEX_VB, ColouriseVBNetDoc, "vb", FoldVBDoc, vbWordListDesc); LexerModule lmVBScript(SCLEX_VBSCRIPT, ColouriseVBScriptDoc, "vbscript", FoldVBDoc, vbWordListDesc); * some digging around there found the `scintilla/include/Scintilla.iface` -> `SciLexer.h` * `SCLEX_AUTOMATIC`: appears to be what you're supposed to use for the first argument to `LexerModule()` when it's not one of the official lexers... * [Post:GedcomLexer announcement](https://community.notepad-plus-plus.org/topic/13105/plugin-update-gedcomlexer-v0-3-3-r100) * [Develop a plugin](https://community.notepad-plus-plus.org/topic/12676/develop-a-plugin) -- implies plugin is doable from g++ * [Plugin Development#Compilers](http://docs.notepad-plus-plus.org/index.php?title=Plugin_Development#Compilers) strongly implies that MinGW will work... but the converter links referenced are dead links :-() * dead link: [found in wayback machine](https://web.archive.org/web/20160307035359/http://forum.icd.no/viewtopic.php?t=64) * convert .sln or .vcproj to .dsw/.dsp using http://www.arstdesign.com/articles/prjconverter.html * download Jose Fonseca's dsw2mak.awk (which might be part of msys... not sure) * http://mefriss1.swan.ac.uk/~jfonseca/gnu-win32/software/msds/dsw2mak.awk -> link appears dead * this might be a version of it: https://github.com/mtek-hack-hack/mtktest/blob/master/%20mtktest%20--username%20qq413187589/N65/N65_V1/tools/MinGW/bin/dsw2mak * gawk -f dsw2mak.awk project.dsw * [gstavi's lexer examples](http://sourceforge.net/projects/lexamples) [sep 2016] -- awww, no source code. :-( * [EmptyFilesAsUnicode](https://community.notepad-plus-plus.org/topic/15067/new-plugin-empty-files-as-unicode) -- he uses CMake w/ Visual C++, so doesn't seem to have the .vcproj file that comes with the template... I might want to study that * @Claudia-Frank's PythonLexer: my collection of links to her effort is at [https://community.notepad-plus-plus.org/topic/16164/bug-javascript-multiline-character-not-understood-by-notepad/11](https://community.notepad-plus-plus.org/topic/16164/bug-javascript-multiline-character-not-understood-by-notepad/11)
See my [previous post](https://community.notepad-plus-plus.org/topic/14754/entering-zwnj-zero-width-non-joiner) on the subject of zero-width characters, and an [earlier post](https://community.notepad-plus-plus.org/topic/14045/invisible-characters-unwanted/15) where I even shared a pair of PythonScript scripts to give a fuller `Show All Characters` and `Don't Show All Characters` functionality
# script = Show All Characters (including ZeroWidth) editor.setRepresentation(u'\u200B', "ZWS") editor.setRepresentation(u'\u200C', "ZWNJ") editor.setRepresentation(u'\u200D', "ZWJ") editor.setRepresentation(u'\uFEFF', "ZWNBSP") # if you want to _also_ show all characters with this script, # first pick a different View > Show Symbols option, # then pick this one (each is a toggle, so don't want to accidentally hide all characters if show-all was already selected) notepad.menuCommand(MENUCOMMAND.VIEW_EOL) notepad.menuCommand(MENUCOMMAND.VIEW_ALL_CHARACTERS) # script = Don'tShow All Characters (including ZeroWidth) editor.clearRepresentation(u'\u200B') editor.clearRepresentation(u'\u200C') editor.clearRepresentation(u'\u200D') editor.clearRepresentation(u'\uFEFF') # if you want to _also_ hide all characters with this script, # first pick a different View > Show Symbols option, # then pick this one twice (each is a toggle, so don't want to accidentally show all characters if show-all was already cleared) notepad.menuCommand(MENUCOMMAND.VIEW_EOL) notepad.menuCommand(MENUCOMMAND.VIEW_ALL_CHARACTERS) notepad.menuCommand(MENUCOMMAND.VIEW_ALL_CHARACTERS) (see also editor.getViewEOL and editor.getViewWS, which I keep forgetting)
* NPP_EXEC npp_run _blah_ : run _blah_ in separate window npp_run cmd /k _blah_ : run _blah_ in separate window, staying in cmd.exe after it's done help : shows help info in console manual : separate 'help' file * NPP Environment Variables $(FULL_CURRENT_PATH) : E:\my Web\main\welcome.html $(CURRENT_DIRECTORY) : E:\my Web\main $(FILE_NAME) : welcome.html $(NAME_PART) : welcome $(EXT_PART) : .html $(NPP_DIRECTORY) : the full path of notepad++'s directory $(CURRENT_WORD) : word(s) you selected in Notepad++ $(CURRENT_LINE) : current line number $(CURRENT_COLUMN) : current column number
Trying to come up with minimal functionList example. Unfortunately, function list basics FAQ has the outline without any specifics.
This example has room for more minimalization... but it shows a basic working example, so let's
Category Before { } START ClassName Category QA_Cold { } Category FT_Cold { } Category QA_Room { } ParamGlobals { } END Category Between { } START SecondClassName Category QA_Cold { } Category FT_Cold { } Category QA_Room { } ParamGlobals { } END
<?xml version="1.0" encoding="UTF-8"?> <!-- ==========================================================================\ | | To learn how to make your own language parser, please check the following | link: | https://npp-user-manual.org/docs/function-list/ | \=========================================================================== --> <NotepadPlus> <functionList> <parser displayName="LtxMxEnVision" id="LtxMxEnVision" commentExpr=""> <classRange mainExpr ="(?x) # free-spacing (see `RegEx - Pattern Modifiers`) (?m) # ^ and $ match at line-breaks ^START\b .*? # whatever, ^END\b " > <className> <nameExpr expr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`) \s \K # discard text matched so far \w+ " /> </className> <function mainExpr="Category \w+|ParamGlobals" > <functionName> <funcNameExpr expr="sub \K\w+|Category \w+|ParamGlobals" /> </functionName> </function> </classRange> <function mainExpr="Category \w+|ParamGlobals"/> </parser> </functionList> </NotepadPlus>
When there is a new version of Perl released with new keywords, I need to update the langs.xml and autoCompletion\perl.xml for any new keywords. Per what Michael Vincent and I worked out, it needs to keep the CGI.pm keywords (the -BGCOLOR attributes, as well as all the html-generation functions, etc), all the builtins, and the pragmas
page look-and-feel inspired by lifehacker.me