[Excellent software recommendation and introduction] Notepad++[Windows]

1. What is Notepad++

Notepad++ is an open source, free, free plain text editor popular for Microsoft Windows.

You can go to its official Github Release page to download the installation file or the Portable version. It is very small, the installation file is only about 4 MB, and the Portable version is only about 3 MB. Small and exquisite is one of its advantages.

2. What is a “plain text editor”

A plain text editor is a tool for editing a file in the form of plain text. This file can be plain text, rich text, or even a picture or a song – of course, for the last two, you have a high probability of opening it. You will see garbled characters that cannot be read by humans.

Plain text editors are often considered “programmers’ use” and “source code” tools. However, Notepad++ is also useful for ordinary non-programmers because of its small size and powerful functions.

▋ Customization

Now assume you have Notepad++ installed on your computer (or have the Portable version unpacked somewhere). When first turned on, it looks like this-

It looks ugly, but it doesn’t matter, it can be improved through subsequent customization.

1. Set Preferences

First, we click Settings > Preferences…, and come to such a window. You can observe that there are a bunch of pages on the left, representing different categories, which can be set.

Personally, because I often need to use it to write some static HTML pages, I will do the following settings:

  • General > Toolbar > ☑ Hide;
  • Editing > Line Wrap > ◉ Default; ☑ Enable smooth font;→ ☐ Enable scrolling beyond last line;
  • Margins / Border / Edge > Border Width: 0; Line Number > ◉ Constant width;→ ☐ Display bookmark;
  • New Document > Default language: HTML;
  • File Association > Notepad: .txt, .log; MS ini/inf: .ini, .inf; Web Script: .js, .css, .json, .php, .xml, .xaml; Public Script: .lua; Misc : .nfo; Customise: .wiki;
  • Backup > Session snapshot and periodic backup > uncheck all ;
  • Auto-Completion > Auto-Completion > From1→ 3th character;→ ☐ Auto-indent; Auto-Insert > ☑ HTML/XML close tag;
  • Cloud & Link > Clickable Link Settings >→ ☐ Enable;
  • MISC. >→ ☐ Enable Notepad++ auto-updater; ☑ Use DirectWrite (May improve…).

These settings are of course very personal preference, so they are here for reference only.

2. Install additional components (Plugin)

Notepad++ provides a rich selection of add-ons, but most of them are for programmers. But there are a few that I personally find very useful, they are:

  • Compare,
  • ExtSettings, and
  • Zoom Disabler.

To install add-ons, click Plugins > Plugins Admin…, select the add-ons you want to install in the window, and click the “Install” button in the upper right corner.

After that, the software will prompt to exit, and after all the selected add-ons are installed, the software will automatically restart. It should be noted that if you are in mainland China, you may need to install add-ons through the “global over-the-wall” mode. If you don’t want or can’t, you can also go to the add-on list of Notepad++, download the corresponding add-on manually, extract the DLL file to the local path, and then manually import it through Settings > Import > Import Plugin(s)… .

If there is no accident, if you also select the three add-ons mentioned above, you should be able to click the Plugins menu after the software restarts and see that these three add-ons are already listed. Most add-ons provide sub-menus, and the setting interface of add-ons is usually in the sub-menu.

3. Select the appropriate word wrap

By default, Notepad++ does not automatically soft wrap paragraphs, which is the effect shown in the figure below.

And if we directly check “Word wrap” in the View drop-down menu,

You will get the effect shown below. (The long line in the picture was added by me to indicate the abnormally long white space in the line.)

This is because Notepad++ only supports word-wrap at word boundaries, which in general may be spaces or hyphens, etc. This may not be a problem, or even a better solution, for Western text segments, but for texts with mixed Chinese and Western texts that are dominated by Chinese characters, this leads to poor readability.

As a workaround, use the second plugin we just installed: ExtSettings.

Click Plugins > ExtSettings > Extended Settings, change the Wrap mode under Line Wrapping to ‘Any character’.

The effect looks much better now.

4. Choose a theme that suits you

Notepad++ comes with 23 themes. We can pick out the ones that are more in line with our own minds, and make slight modifications on top of them (such as modifying the default font type, font size, etc.).

Notepad++ of course also supports importing external themes. Personally I’m currently using a theme called Material-Dark, which can be found here . In addition to this, there are plenty of good-looking Notepad themes on Github and the wider Internet with a proper search.

So suppose, we downloaded Material-Dark locally. Then you can import the theme through Settings > Import > Import style theme(s)…. After importing, click Settings > Style Configurator… to select the corresponding theme in the window shown below and modify it.

5. What type of font should I choose?

A good-looking theme naturally requires a good-looking font file to match. However, the font file can not only be good-looking.

The font file selected by Notepad++ in the default theme is a monospace font file, which is a choice that follows the habits of programmers. If you usually don’t use Notepad++ to write the source code of the program most of the time, you don’t need to choose non-monospaced fonts. You can choose another font file boldly.

However, we also need to consider whether a font file can be used for all the languages ​​we may encounter. For example, the font file of Microsoft Yahei, despite its ugly appearance and the strange comma at the bottom, its support for non-simplified characters is very poor, and it is always high and low, fat and thin. .

Therefore, when choosing a font file, we may need to consider first: what text do I need this font file to display? For me, in daily life I need it to display correctly at least: basic latin characters, extended latin characters, kanji, kana, greek characters, cyrillic characters, etc., so the best solution is to find A font file that displays Unicode characters as fully as possible.

So is this the end? No. Sometimes there is also the speed at which this font file renders long text when it is specified as the global default font in Notepad++. As you can see in the picture above, I chose an open source font file called “Gansha Black Body” ( available here ), but it’s not necessarily the best choice. According to my personal observation, it will stutter slightly when rendering long documents with many Chinese characters. I can accept this lag, but if the lag is more obvious on your computer, you can try to use another font file instead.

A historical version of Inziu Iosevka, a previously abandoned project by the same author, does not have the above problem (please take care to choose the download file with the inziu- prefix, and if you are still using Windows 7 / Sever 2008 R2 or earlier operating system, select the version with ‘ttf(s)’ in the filename).

Of course this goes a long way. However , the author ‘s open source font file has done a good job, and he is very particular about it. A font category is subdivided into many branches. If you need monospaced fonts and almost full Unicode character support, you can try his font file. In short, after using his font and Material-Dark theme, Notepad++ was finally customized by me to look like the one shown below.

6. The Forgotten Compare Add-on

The Compare add-on is not difficult to use. However, there is one more word here, that is, the default color matching of Compare is designed for light mode. If a dark mode like Material-Dark is used, it is better to adjust the color of Compare accordingly. Otherwise Compare’s highlights will look unpleasant in dark mode. This is of course a matter of personal preference. I personally also randomly chose a few colors, which is probably similar to this.

▋ It is said that it is powerful, where is it strong?

For programmers, there may be many ways to play Notepad++. But for me, it’s powerful in this little window—

Just in Extended Mode, there are already many ways to play, and you can quickly perform some basic dirty text cleaning. If you know Regular Expression, you can enjoy more gameplay after switching to Regular Expression Mode.

What is Regular Expression? To give a simple example
, how to replace all date strings that look like “10/24/2048” in a text with a pattern that looks like “24/10/2048”?
Very simple, just fill in the Find what: column (\d{2})\/(\d{2})\/(\d{4}), and fill in the Replace with: column \3 年 \2 月 \1 日, and then click Replace All.

My RegExp is a child who repeatedly groped and learned without a teacher, so I won’t make a fool of myself here. If you don’t know Regular Expressions yet, you can easily learn about them through Regular Expressions for Regular Folk , an introductory tutorial on the web. Notepad++ official also provides detailed instructions about this powerful small window frame .

If you need to perform some repetitive operations in batches, you can record these actions as a macro. Click Start Recording in the Macro menu to start recording, and the recording is complete (of course, click Stop Recording) ), you can save the recorded macro and assign shortcut keys to it. Click Modifiy Shortcut / Delete Macro… at the bottom of the menu to perform simple management operations on the recorded macros in the window shown in the second picture below.

Trying to rewrite a recorded Macro later is almost impossible, because Notepad++ uses a very primitive and verbose language that is almost machine script-like for recording macros (this is related to the parent software Scintilla on which it is based). ). If you need to back up the macros (for use on a new device or after a system reboot), you can go to %AppData%\Notepad++ and copy the shortcuts.xml out of the backup. If the Portable version is used, backup shortcuts.xml in the software directory. Attached is a list of macros that I personally use (also recorded by myself) (most of them are doing replacement work with the Replace window).

▋ Conclusion

After this simple configuration, Notepad++ can be used. I usually use it to clean and format some dirty text. Also use it to write your own blog (basic static HTML page), write your own private wiki, and write this little Markdown article.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.