How to Make Notepad++ Compare Two Files With a Plugin

Delta Online News
compare-two-files-notepad

Notepad++ is a free, open-source, code and text editor jampacked with lots of features for both casual users and programmers. It supports various programming languages with custom syntax highlighting, auto-completion, and code folding.

The inclusion of sophisticated editing tools, user-defined style options, and support for plugins is like icing on the cake. One such powerful plugin is the Notepad++ Compare plugin which lets you see the visual difference between the two files. We’ll show you how to use this plugin to compare two files in Notepad++.

Basics of Plugins Admin in Notepad++

Plugin Admin or Manager is the repository of dozens or more plugins to extend the functionality of Notepad++. Before you start using them, there are a couple of settings you should watch out for while installing the app.

On the Choose Component screen during installation, make sure to select the Custom option from the dropdown list and check Plugins Admin box. Many users skip the installation steps. If you do so, then the plugin manager will not get installed. Slowly proceed with the steps while installing Notepad++.

select plugin admins option while installing notepad++

Notepad++ keeps configuration files in the Users[User Name]AppDataRoamingNotepad++plugins folder.

If you plan to use this app on another computer or store in a USB drive, then check Don’t use %APPDATA box.

Your configuration files will remain in the Program Files folder.

don't use the appdata option in notepad++

Plugins Admin lists all the available and installed plugins. From here, you can install, update, or remove installed plugins. A revamped version came into effect in version 7.6 and above. If you want to use the plugins, then upgrade Notepad++.

Installing the Compare Plugin

Open Notepad++. Navigate to Plugins > Plugins Admin to open plugins manager. In the popup window that appears, type in Compare on the search bar. Check the box, then click Install. Once the plugin gets installed, the app will restart.

plugins admin notepad++

Click the Compare tool option from the Plugin menu. As of now, you can download the latest iteration of this plugin (version 2.0.0) from Github. Both 32-bit and 64-bit versions are available.

choose the compare option from the plugins menu

How to Compare Two Files in Notepad++

The compare plugin assumes that you want to compare an old version of your work versus the new version. Open any two files (A, B) in Notepad++ which you want to compare. File B (new) gets compared to File A (old).

Then, navigate to Plugins > Compare Menu > Compare.

comparing two files in notepad++

It shows the difference/comparison side by side, as shown in the screenshot. You can set any open file as the default by clicking Set as First to Compare. You can then choose this selected file to compare it with other ones in whatever mode you decide.

Colors and Symbols

The compare plugin uses various colors and symbols to denote the changes in your file. You could have added, deleted, moved, or changed the line.

  • Added (+): The line only exists in the new file and not the old ones. The highlight color is green.
  • Removed (-): The line does not exist in the new file and only present in the old file. The highlight color is red.
  • Moved: The line appears once in the other file and a different location.
  • Changed: Most of the line is identical in both files. You’ll see the changes highlighted in orange.

Note: If you uncheck the Detect Moves option in Plugins > Compare Menu the meaning of symbols changes. Therefore, whenever you’re comparing two files in a session, always check for this option.

file comparison areas highlighted in various colors and symbols

Navigation Bar

The navigation bar to the right side of the Notepad++ comes handy when you’re comparing big files. In a big file, navigating the whole file by going up and down to find the difference is difficult and time-consuming. The navigation bar works like a sitemap and bookmark browser.

navigation bar in notepad++

Click the selected area to scroll in your file. Since it uses the same convention for colors and symbols, you’ll come to know which line was added, removed, and more with a glance.

Changing the View Modes

By default, when you compare two files, it does so in double-view mode. Right-click the gripper and choose Rotate to right or left. It either splits the window horizontally or vertically.

view modes in notepad++

And if you continue rotating, your old file appears in the left while the new file appears in the right panel. It is recommended to restart Notepad++ after shifting from horizontal to vertical split or vice-versa.

Time-Saving Uses of the Notepad++ Compare Plugin

We often need to compare two files. The tool enables you to compare the original and modified files and list the lines you’ve changed. It has many practical uses:

  1. If you’re working on a code and want to see the changes other people made, then a compare tool can make comparison easier.
  2. You can precisely check the line with any code errors, defects that you don’t remember, and find the source of your problem.
  3. Any difference gets highlighted in various light and dark color hues to help you identify changes.
  4. You can compare files in a folder and know which directory is missing what files. This is useful if you have a large collection of music or ebooks on your computer.

When you click the Compare menu, it shows a popup with all the commands and options. It even lists down the keyboard shortcuts for those commands.

Explore the Settings

The compare plugin has all the basic features of a standard Diff tool. Click Settings to see the list of options you can tweak.

  • Color Settings: This option allows you to set color coding for Added, Deleted, Moved, and Changed line. For each option, you can choose a different color, change the highlight color, and its transparency.
  • Menu Settings: This option enables you to customize the file positions. First is determines whether you’re comparing the old or new file. Old file position allows you to position the old file at the left or right view (top/bottom in vertical split). Single-view default compare to lets you compare the active file in a single-view mode with the previous or next file.
  • Warn about encodings mismatch: shows you a warning message on trying to compare two files with different encodings.
  • Wrap around diffs: Determines whether it should enable the Next command on reaching the last diff and go to the first diff.
  • Go to first diff after re-compare: When unchecked, the caret position will not change on re-compare.

compare plugin settings

Compare Microsoft Office Files

Notepad++ is a flexible code and text editor app. You can customize it to any level depending on your needs. The compare plugin is a solid example which shows the power of plugins. You can compare a text, markdown file, or any programming language file.

With the flexible view modes and settings, this plugin is just as good as a Diff tool. But for some reasons, you cannot compare proprietary file formats like DOCX, XLSX, and more. If you want to know the procedure, look at our guide on how to compare two excel files and Microsoft word documents.

Read the full article: How to Make Notepad++ Compare Two Files With a Plugin

MakeUseOf