Tips for using notepad ++

Source: Internet
Author: User
Document directory
  • Nppexport
  • Explorer
  • Textfx
As a novice programmer, I have always liked notepad ++ on the Windows platform. It is lightweight, customizable, and easy to use. The following describes some of my experiences when using notepad ++. Shortcut Key

This is relatively basic. You can modify it in Settings> Manage shortcut keys. For example:

  1. Move the current row up and down CTRL + Shift + up/down;
  2. Copy the current row Ctrl + D;
  3. Function parameter prompts Ctrl + Shift + Space
  4. Line comment, block comment ....

Because many default shortcut keys have been modified by me, I will not illustrate them here.

It should be noted that many times we find that the shortcut key settings are useless, for example, CTRL + ALT, because it conflicts with other software such as the input method and QQ shortcut keys, at this time, we need to change the shortcut key to a hot key not used by other software.


Automatic completion and character encoding

A friend once switched to another IDE because notepad ++ did not automatically complete the function. But in fact, the small notepad ++ also has this function, as shown in Settings> preferences:



In Web programming, character encoding is very important. Currently, UTF-8 encoding is popular. You can choose the default encoding in Settings> New. If no changes are made, the default value is ANSI encoding.

Environment Variable

Notepad ++ has its own environment variables



Variable name

Description

Full_current_path

File Path Name

Current_directory

File directory

File_name

Full file name

Name_part

File Name

Ext_part

File Extension


With these variables, We can customize many things.

  • C language compiler

    You can search for details on the Internet. I will briefly explain my practices. For other languages, you only need to replace the compiler with the appropriate ones:

  1. First, you have to install a compiler. For C language, I recommend using gcc, and then add GCC to the system path.
  2. Run the following command:

    CMD/C gcc-o $ (current_directory) \ alias (name_part1_.exe $ (full_current_path) & Exit and save the name for compilation (it is best to assign a shortcut key for it for convenience ).

  3. Run the following command:

    CMD/C $ (current_directory) \ alias (name_partcmd.exe & pause & Exit, save it as run (assign a shortcut key ).

  4. Note: All commands of cmd gcc can be understood. For example, $ (full_current_path) is the usage of notepad ++ environment variables. You can understand it in the preceding table.

  • Open a file

    Through the environment variables described above, we can customize the file opening method. For example, I define a shortcut to debug webpages on the local server.

Chrome.exe http://localhost/$(NAME_PART)$(EXT_PART)

In this way, when I press the shortcut key, the webpage points to localhost.

Plug-ins

We recommend several useful plug-ins below

Nppexport

This is the default plug-in installed by notepad ++. With this plug-in, we can easily export the code after coloring, even in word, we can also easily paste the colored code.

Explorer

This plug-in needs to be installed by the user. With this plug-in, we can enable the resource browser function in Notepad ++, as shown in


Textfx

This plug-in can easily define the auto-completion feature of parentheses.

There are also functionlist, jsonview, and other plug-ins that help us analyze code. Here we will not illustrate them one by one.

In short, notepad ++ is a lightweight but powerful editor. After being configured, We can discard any other ide.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.