Running NotePad++ from Command line with Compare Plugin showing compare result

后端 未结 2 1494
醉话见心
醉话见心 2020-12-11 04:16

I am trying to find a way to call notepad++ from command line with compare plugin showing the compare result providing I pass 2 files name which I want to compare.

T

相关标签:
2条回答
  • 2020-12-11 04:37

    There's a tool called NppCompareLoader doing exactly what you want. Simply drop it in the N++ installation folder. I'm using it since many years as a diff viewer for TortoiseSVN and TortoiseGit, thus you should certainly be able to call it right from command line.

    /EDIT

    Since the (unofficial) Compare-plug-in version 1.5.6.6 the additional loader mentioned above isn't required anymore. There's already one included in the plug-in. Here's the regarding change-log fragment:

    • NEW: Loader for using N++ as an external diff viewer (e.g. in TortoiseSVN, TortoiseGit, ..)
    0 讨论(0)
  • 2020-12-11 04:42

    tl;dr:

    The command is Notepad++\plugins\ComparePlugin\compare.exe file1 file2.

    Details:

    Download the compare plugin https://bitbucket.org/uph0/compare/downloads/ComparePlugin.v1.5.6.6.bin.zip. Installing the compare plugin from the plugin manager within Notepad++ does not install the requisite exe. I assume you could also build from source to obtain the exe.

    Follow the manual installation instructions in the readme:

    To install manually, copy ComparePlugin.dll and ComparePlugin subfolder into the plugins directory C:\Program Files\Notepad++\Plugins.

    For a portable Notepad++ installation, you need to run the command from a directory above the notepad++ directory (or with absolute path of exe), otherwise you get an error that Notepad++.exe is not found.

    The commands look like this:

    >cd C:\portapps\Notepad++
    >cd ..
    >Notepad++\plugins\ComparePlugin\compare.exe C:\files\file1.txt C:\files\file2.txt
    

    ufo's answer put me on the right track but it did not contain the commands to run.

    0 讨论(0)
提交回复
热议问题