Many times it could be useful to open and edit a file in a straightforward way with a mouse click without any further action.
Let’s open a terminal window and type in the following command, which will create a new script file in our nautilus scripts directory
user@pc:~$ gedit ~/.gnome2/nautilus-scripts/Open\ file\ with\ gedit
Write the following script lines:
filesall=”"
while [ $# -gt 0 ]
do
files=`echo “$1″ | sed ’s/ /\?/g’`
filesall=”$files $filesall”
shift
done
gedit $filesall&
Save the script and close gedit, then execute the already known command to make the script executable:
chmod u+x ~/.gnome2/nautilus-scripts/Open\ file\ with\ gedit
Now when you right click a file in gnome environment, you should see the related context menu item “Open file with gedit”