I'm editing a bunch of foo.r files (source R files for an R packages) in Ubuntu Unity 12.10. Every time I click on one of these files to open it in gedit, a dialogue box comes up: "Do you want to run foo.r, or display its contents?" and then I have to click on a "display" tab. Can I make it open automatically in gedit? Note that gedit is already set as the default open-with program.
Run in terminal:
gsettings set org.gnome.nautilus.preferences executable-text-activation 'display'
Or you can launch
dconf-editor and navigate to /org/gnome/nautilus/preferences, then select the
executable-text-activation key. Here is its description:
What to do with executable text files when they are activated (single or double clicked). Possible values are "launch" to launch them as programs, "ask" to ask what to do via a dialog, and "display" to display them as text files.