5

I'm looking for a GUI text editor with an integrated diff feature. I'm used to Notepad++ on windows and its diff plugin. Now I am using a Linux machine and I can't seem to find something similar.

I have tried:

  • Notepadqq which has most (if not all) the features of Notepad++ but it's lacking on the plugins side and doesn't have a diff plugin yet.
  • Geany has a diff plugin but apparently it works only for files under version control.
  • I heard there's a way to integrate Kompare with Kate but I can't seem to find a step by step instructions to do this.
  • I already use Atom and Eclipse but I use those for my javascript and Java projects, respectively, and with all the plugins I have installed it's kinda heavy. I'm looking for a lightweight text editor I can open in little time.
  • I have tried to run Notepad++ on Wine but as soon as I use the compare Plugin it crashes.

I know I can use Kompare or Meld but i'm not looking for a compare tool, I am looking for a text editor which could help me compare files whenever I need. I use those applications already when i have to compare many files at once, also those diff tools miss most of text editors features i need, such as code highlight, various text operations (indentation help, newline conversion, change encoding....).

On top of that sometimes I need to compare pasted text without saving files, so I open two new documents on Notepad++ and then paste the text I need to compare there.

I am using Linux Mint with KDE.

This is how the Notepad++ plugin works on windows:

  1. Open 2 files (in case more than 2 files are open, the compare plugin will use the one just right the current file)

enter image description here

  1. Use the compare plugin enter image description here

  2. It starts a split view with a classical diff interface showing removed lines, added lines or lines that are slightly different

enter image description here

6
  • 1
    Well, it's kludge, but the Eclipse IDE will save a private version of every file you save, which it calls "local history". Plus, it has a "compare with local history" option, so just overwrite the files contents whit the file to be compared & compare with the newest local history
    – Mawg
    Nov 1, 2017 at 9:14
  • 2
    Or, why not just edit directly in meld, kdiff3, etc? What am I missing here? Which editor features do you need which a visual file diff tool does not offer?
    – Mawg
    Nov 1, 2017 at 9:16
  • 1
    Code highlight, various operations (indentation help, newline conversion, change encoding....), not having to open 2 different programs, being able to compare pasted text without the need to save files, being able to compare files on the fly while working...
    – valepu
    Nov 1, 2017 at 10:29
  • 1
    Thanks for specifying (+1). I would recommend you to update the question with these details (and maybe add the gratis tag, or add a budget). You are active enough on S.O, so know that the more info you can give us, the better that we can help you.
    – Mawg
    Nov 1, 2017 at 12:05
  • Thanks for your suggestion. On S.O. i already know what are the meaningful informations i have to provide, here i thought "a Lightweight Text Editor like Notepad++ which can compare files but for linux" was enough, but you are right I need to be more specific, i'm going to update my post. Thanks again
    – valepu
    Nov 1, 2017 at 16:54

4 Answers 4

1

Adding to @ivanivan's answer, when I opened Meld (version 3.22.0) I found out that there is an option in the welcome screen called Blank comparison:

Meld Main screen

It turns out that this does what the question is asking about, that is, perform a comparison on the fly. Here is a comparison example of latex text and the revised version by ChatGPT:

Meld Blank comparison

2

It's a bit heavyweight, but you could use Eclipse and its "Compare With... /Each Other " feature.

You can edit inside both panels (syntaxchecks are disabled then), and re-compare

There are many other comparison options (compare with git HEAD, compare with Local History, etc)

A screenshot is attached.

enter image description here

1
  • Thanks for your answer. I'm already using Eclipse for Java projects, i need something lightweight for everyday use
    – valepu
    Nov 1, 2017 at 10:48
2

If you take the *nix approach and have a tool that does one job, and does it well, and glue your tools together you can do it. :)

In Geany (yes, I see you tried it...) you can set custom build commands. No version control plugin or actual VCS to worry about.

On my Mint desktop system, I just installed meld - use whatever GUI diff tool you want, it just needs to take the 2 file names to compare as arguments.

In Geany, click on the Build menu, then click Set Build Commands. Down towards the bottom, in the Execute section click an empty button and create a new command/action - label it as "Diff tool" or whatever you like.

For the actual command , enter

/usr/bin/meld "%f" "`zenity --file-selection`"

This will call my installed meld, giving it the open file in the current window as the first argument, and launches a zenity file-picker dialog to let you pick the other file. Once you've selected the other file, it calls meld with both filenames/paths as arguments.

Since you are using KDE you can replace the zenity call with something native to KDE if you'd rather...

enter image description here

enter image description here

3
  • 1
    So, after setting this up in Geany, how do you launch the comparison? Some shortcut? And no way to compare two files open in Geany without finding one of them again in the file system? Thanks!
    – Nicolas Raoul
    Nov 1, 2017 at 6:10
  • 1
    Yes, once you've added teh menu item it will show up under the "Execute" section of teh "Build" menu. Gonna edit my post and include a screenie. Not sure if it can reference a file open in another tab, only spent a few moments researching for you
    – ivanivan
    Nov 1, 2017 at 11:12
  • I read you can do something like this even on Kate, with the run command plugin, i was just hoping there was a text editor with an integrated diff
    – valepu
    Nov 1, 2017 at 17:06
1

CudaText also has a plugin called Differ to compare files.

enter image description here

This plugin does not work the same way as notepad++ compare plugin: here Differ can compare only content of files not content of tabs.

Install notes:

  • on linux, the path of python must be manually set in users.json, as mentioned in default.json (Options -> Settings-Default)
  • to install this addon select Plugins -> Addons Manager -> Install from GitHub: enter URL

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.