You can now add Open with gedit to the right click menu in Ubuntu.The file browser in Ubuntu provides the ability to run scripts on a selected file.
1. Goto Applications -> Accessories -> Terminal.
2. Type in the following command, which will create a new script file in our nautilus scripts directory
gedit ~/.gnome2/nautilus-scripts/Open\ with\ gedit
3. Copy & Paste the following script,
#!/bin/bash
#
# Nautilus script -> open gedit
#
# Owner : Largey Patrick from Switzerland
# patrick.largey@nazeman.org
# www.nazeman.org
#
# Licence : GNU GPL
#
# Copyright (C) Nazeman
#
# Ver. 0.9-1 Date: 16.02.2002
# Add multiple file open in the same windows
#
# Ver: 0.9 Date: 27.10.2001
# Initial release
#
# Dependence : Nautilus (of course)
# Gnome-utils (gdialog)
#
filesall=—
while [ $# -gt 0 ]
do
files=`echo “$1″ | sed ’s/ /\?/g’`
filesall=â€$files $filesallâ€
shift
done
gedit $filesall&
4. Save(Ctrl+S) and close the gedit window.
5. Now execute the following command to make the script executable:
chmod u+x ~/.gnome2/nautilus-scripts/Open\ with\ gedit
6. Now when you right click a file, you should see “Open with gedit”.