Site icon That Irish ID

How To Use Notepad++ To Edit Code

Tags: Notepad++; Source code; Edit; Software

Save time using Notepad++ to create code for your projects. This topic explains the common functionalities of Notepad++ that technical communicators use in projects such as editing or viewing XML or DITA files.

For version v7.5.9 (Windows 64-bit and Windows 32-bit) or higher.

This article is about the software application Notepad++. For notepad software, see external link: Notepad software (disambiguation).


About Notepad++

Notepad++ is a free, open-source code editor. It uses minimal computer resources, making it a fast and powerful editor. You can use Notepad++ for everything from storing short text to advanced coding. It is optimized for programming languages, making it ideal for coding in languages like XML, HTML, and CSS.

The common code-based features of Notepad++ that will help you as a technical communicator are:


Open a source code file

There are many ways to open a source file using Notepad++. Outlined below are the two most common methods. Each time you open a file, it will open in a new tab. Notepad++ does not close any previous files unless instructed by you.

⚠️ Warning: It is not recommended to change the default file association to Notepad++. This may cause your files to behave incorrectly.

Open using Drag and Drop

  1. Open Notepad++.
  2. Using Windows Explorer, drag and drop the file into Notepad++.
  3. Outcome: The file is open in Notepad++.
Animation: Drag and drop a file into Notepad++

Open using Windows Explorer

  1. From Windows Explorer, select the file you want to open. n

Note: If the file was received as an email attachment, external link: download the attachment to your computer.

  1. Right-click on the file.
  2. In the context menu, select Edit with Notepad++.
  3. Outcome: The file is open in Notepad++.
Image: Using Windows Explorer

Enable syntax highlighting

When working on your source code, Notepad++ will highlight the syntax, i.e. reserved words, for your source code. This functionality helps improve the readability of your code. Notepad++ supports syntax highlighting in external link: 78 programming languages.

  1. From the menu bar, select Language.
  2. Languages are listed in alphabetical order. Some languages are nested under the first letter to save space. Select the programming language name to apply the syntax highlighting, e.g. HTML.
  3. Outcome: The file displays the syntax formatting for your source code.

Note: If your language is not listed, Notepad++ supports user-defined languages.

Animation: Highlighting HTML syntax.

Save your programme

If you are saving your file for the first time, you will need to save it to the correct extension.

Note: If you have enabled syntax highlighting, the Save as type will match the syntax highlighting you selected}.

  1. Select File > Save As
  2. Choose a file location, such as My Documents or This PC, to store your file.
  3. In the File name box, enter a new name for the file.
  4. In the Save as type list, select the file format you want to save the file. For example, click Cascade Style Sheets File (*.css) to save a CSS file.
  5. Select Save.
  6. Outcome: The file is saved with the correct file extension.
Image: ‘Save As’ dialogue box.

See also

For additional help and support, check out:


Notes and references

Baker, M. (2013) Every Page Is Page One, XML Press: Laguna Hills, CA.

Ho, D. (2021) What Is Notepad++ [online],Notepad-plus-plus.org, available: external link: https://notepad-plus-plus.org/ [accessed 1 Mar 2021].

Exit mobile version