Notepad++ is an enhanced version of notepad under Windows. It is written in C++, with excellent performance, not only small (the complete installation package is only 3.8mb), many features, rich plug-ins, and most importantly, “completely free”! This is a big selling point compared to other Text processors such as Editplus, UltraEdit, and Sublime Text.

Say so much let’s get down to business, in the daily research and development, data processing process, inevitably and a variety of text, data, code to deal with, today to count Notepad++ 10 powerful and little-known features, teach you how to quickly use it to deal with a variety of text problems, get twice the result with half the effort.

1. Automatic saving

If you use Notepad++, don’t worry. By default, it will save a copy of the content you are editing in real time to %appdata%. Every time you open an unsaved file, it will automatically recover from the copy without worrying about losing any edit data! Unless the disk is damaged, for individual users, I think Notepad++ with cloud disk real-time synchronization function, to achieve data three nine or four nine reliability is not difficult, right?

2. Edit read-only files

Sometimes we can edit some system files, such as C:\Windows\System32\drivers\etc\hosts, and then we know that the file is read-only and has no permissions. Under Linux VIm, we can :w! Sudo tee % edit read-only files directly, but what about under Windows? I’m gonna pull out the file and right click to remove the properties? It’s too much work! Notepad++ under [edit] → [remove read-only mark] can be quickly resolved.

3. Column editing

Now what if I add a TAB at the beginning of each line of text? Sed -r ‘/^/\t/’ In Notepad++, press Alt to enter column editing mode, then press TAB to perform the same operation for each selected row.

What if you had to add a consecutive number to the beginning of each line? Do you want to automatically fill it in Excel and copy it? Notepad++ press Alt +c to enter column edit insert mode, set the corresponding initial value, step size can be.

4. Monitor logs

How do I get the latest log if the log file has changed? If it’s a low-frequency change, notepad++ will automatically detect the change and tell you if you want to load the latest file, but if it’s a frequent change, like once a second:

while sleep 1; do echo $((i++)) >> 111.txt; doneCopy the code

How to deal with it? Tail -f for shell?

Luckily, notepad++ already has this functionality built in: [view] → [monitor log]

5. Find replacements

Notepad++ is very powerful for find and replace, with full support for PCRE style regex and the ability to print matches in a separate window or, in a friendlier way, mark up search results.

For example, what if you need to merge multiple rows into one row? Just check extended mode and type \r\n.

Such as how to again to repeat line to a file, don’t want to upload the sort under Linux | uniq to arise? Notepad++ just type the regular expression ^(.*?). $\s+? ^ (? =.*^\1$) and check to match the new line.

6. Format, coding and symbols

Notepad++ in [encoding] menu built-in almost all encoding support, you can freely switch, debugging coding problems very convenient.

Notepad++ can also be easily supported by double clicking on the bottom status bar to switch:

Sometimes the text contains some invisible special characters, resulting in some puzzling problems in the process of program processing, such as carriage return newline characters, UTF8 BOM marks, etc., we can open [View] → [display symbols] → [Display all characters], so that all characters are invisible, at a glance:

7. Custom syntax highlighting

Notepad++ has built-in syntax highlighting for dozens of languages. Users can modify and customize themes as they like. However, some languages are not supported, such as scala.

Gist.github.com/MihailJP/45…

  1. Download userDefineLang.xml
  2. If this is the first user-defined language you are adding, move the entire file (userDefineLang.xml) to %APPDATA%\Notepad++. If you have already installed other languages, just copy the content from

    to and paste it at the end of userDefineLang.xml right before
  3. Save the userDefineLang.xml and restart Notepad++
  4. Github.com/nfang/scala…

Of course, you can also redefine a language theme that suits you.

Eight, to heavy

What would you do if you had a file to redo? How about a little script?

With notepad++ this solution becomes extremely easy, just press CTRL + u!

TextFX is a powerful plug-in that provides a lot of text processing and conversion functions. If you are interested, you can explore it.

9. Compare files

Linux has diff, Windows has a lot of software for file comparison, but most of them are charged, but notepad++, the problem is extremely simple: just press Alt+D!

What’s behind all of this is that notepad++ uses its own plugin to compare:

10. Insert formatting highlighting code into powerpoint

Sometimes technical sharing needs to insert a syntax highlighting, neatly formatted code into PPT, but you find that there is no, no matter from the IDE editor or HTML page copy and paste into PPT, the format, color will be wrong or lost. The essence is that PPT in Office is positioned not as a powerful text editor (Word), but as a Power + Point product with visual output of pictures for users to express their opinions. Therefore, some students on the Internet have come up with various ways to “save the country by curve”, such as pasting PPT into Word first. And then copy and paste it into powerpoint, or just take a screenshot and paste it into powerpoint, but that’s not what we want.

Here with notepad++ we can be very convenient to achieve this requirement:

(1) first use the NppExport of notepad++ to copy the code content and format RTF to the clipboard

(2) Then in the PPT, press Ctrl+Alt+V to paste, and there will be no change in color and layout

See yet? There are only two steps, two sets of shortcut keys to easily solve the annoying problem of incorrect or missing paste code in PPT.

11,

Notepad++ some features or functions introduced above, perhaps other software has another solution, but can like notepad++ such a comprehensive person is very rare. In addition to notepad++ also has some practical functions, this article will not expand, interested students can explore mining, such as: macro recording, custom shortcut keys, TAB conversion, running commands, obtain file path, plug-in management, etc..