Comparing files using gEdit
Monday, 16. June 2008, 13:23:12
I found a very nice way using Meld. Meld is a graphical comparsion tool and will work very well as an external tool of gEdit:
1) Install the package "meld"
2) Start gEdit and opening the Menu "Tools > External Tools..."
3) Add a new external tool:
* Name: Compare Files
* Description: Compare then opened file with another
* Command:
#!/bin/sh meld $GEDIT_CURRENT_DOCUMENT_DIR/$GEDIT_CURRENT_DOCUMENT_NAME `zenity --file-selection --title=File for comparsion --filename=/home/` &* Any othe roption is not interesting so press close
4) Now you have in "Tools" an menu entry "Compare Files" that will use the active document of gEdit and the other browsed file for comparsion
Happy computing









Anonymous # 16. June 2008, 14:23
Hello,
I have meld installed.
I have an error :
/bin/sh: Can't open meld $GEDIT_CURRENT_DOCUMENT_DIR/$GEDIT_CURRENT_DOCUMENT_NAME `zenity --file-selection --title=Datei zum vergleichen
Exited: 512
Strange ?
area42 # 16. June 2008, 18:54
#!/bin/sh
meld $GEDIT_CURRENT_DOCUMENT_DIR/$GEDIT_CURRENT_DOCUMENT_NAME `zenity --file-selection --title=Datei zum vergleichen auswählen --filename=/home/` &
?
What happens when you try to start meld /path/to/file.txt /path/to/another/file.txt at the shell?
Anonymous # 16. June 2008, 20:11
Sorry, i have put all on the same line :
#!/bin/sh meld $GEDIT_CURRENT_...
I'm under ubuntu hardy 64.
Zenity is installed (under gnome).
When i try to start meld @ the shell, all is working fine...
I have two css files opened in gedit and when i run the script, meld opens with an error > invalid arguments received > 4
area42 # 17. June 2008, 07:55
at the first tries i get the same errors. Make sure that there are spaces just after meld, after $GEDIT_CURRENT_DOCUMENT_NAME and after ... home/`. Any space between will accept Meld as the next file.
Anonymous # 18. June 2008, 11:57
It does not work.
But I will try to correct the problem.
For now, I especially look forward to seeing to see CSSdev :)
Thank you very much for your great job
Anonymous # 31. July 2008, 14:02
Right script to take care of filepath spaces:
#!/bin/sh
meld "$GEDIT_CURRENT_DOCUMENT_DIR/$GEDIT_CURRENT_DOCUMENT_NAME" "`zenity --file-selection --title=File for comparsion --filename=/home/`" &
area42 # 31. July 2008, 15:25
"" <- is a good idea
Anonymous # 13. May 2009, 19:10
Hi,
I first wondered why I don't have the "External Tools" Option. I added it at "Preferences - Plugins" for the case someone has the same issue.
Your instructions worked perfectly for me.
Thanks.
area42 # 13. May 2009, 20:26
External Tools Plugin Command Collection
http://live.gnome.org/Gedit/ExternalToolsPluginSnippets
Anonymous # 14. May 2009, 19:25
Thanks for the link I'll have a look.
Anonymous # 11. September 2009, 14:45
Thank you for this useful tutorial.
This was exactly what I was looking for.
It works perfect on jaunty.
]andy[
Anonymous # 12. November 2009, 08:32
Thanks for the tip !! I have to work on linux for a while, this trick is really handy.