Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to configure gedit so that everytime I double click on a text file it will open on a new window instead of a new tab. How can this be done?

Something like,

gedit --new-window "file name"

, but with a double click

Using ubuntu 12.04 with cinnamon, and gedit - Version 3.4.1

share|improve this question
up vote 6 down vote accepted

There is a gedit setting called notebook-show-tabs-mode, which is usually set by default to 'always', which means every new document opened will open in a tab. However, if you set it to 'auto' by entering the command below in the terminal, gedit will not open in a tab unless another document is currently open.

gsettings set org.gnome.gedit.preferences.ui notebook-show-tabs-mode 'auto'

However, if you want to make sure that no tabs are ever opened, choose the 'never' setting, so that is probably what you want. You may then need to use the File menu within gedit to switch between documents, although gedit will still warn you when you try to close it if there are still unsaved documents. This is the command you want in this case:

gsettings set org.gnome.gedit.preferences.ui notebook-show-tabs-mode 'never'

To return to the default settings, use 'always' in the command above instead. You can also find the whole list of hidden settings for gedit by entering

gsettings list-recursively | grep -i gedit

but I think the notebook-show-tabs-mode setting is maybe the one you want.

However, after considering your comment, I think you could also use the standalone (-s) gedit option, as that will open each new document in a new window. Create a .desktop file like this and make it executable and put in ~/.local/share/applications:

[Desktop Entry]
Comment=gedit standalone
Exec=/usr/bin/gedit -s %U

Then simply associate it with text files by editing ~/.local/share/applications/mimeapps.list and add the following to these sections of the file (backing it up first):

[Default Applications]


[Added Associations]

Replace geditspecial with the name of your own .desktop launcher. Now when you click text files they will all open in separate instances.

share|improve this answer
That was a cool thing to learn, although not what I was looking for. This hides the tabs, what I want is to open a new window. This way I can see 2,3,4 files at the same time, just a matter of placing them correctly in the screen. Also I when changing files I can do it the same way I change between programs, "alt"+"tab" or one click in the "all open programs" tabs (I don't know the name of this thing). – Presbitero Nov 19 '12 at 1:33
@Presbitero see my edit. – user76204 Nov 19 '12 at 2:03
Worked perfectly, thanks! – Presbitero Nov 19 '12 at 2:22

I also need this. I suddenly find simpler solution:

sudo nautilus /usr/share/applications/

Point to gedit, hit Alt+Enter (Properties), and replace command to

gedit -s %U

Tested on Xubuntu 12.04.2 LTS. Hope it helps.

share|improve this answer

Very good feature for multimonitor configuration to look at the one file and edit other. But some time we may use single window configuration. To use both:

  1. Run (as it described by user2223633):

    sudo nautilus /usr/share/applications/

  2. Point to gedit and create a copy (ctrl + c, ctrl + v).

  3. Rename the copy to a name understandable for You.

  4. Point to new gedit copy.

  5. Hit Alt+Enter or RightClick -> Properties (as it described by user2223633).

  6. Replace command to (as it described by user2223633):

    gedit -s %U

  7. Close the Nautilus window (opened by root) as soon as possible.

  8. Open a Nautilus window or use Desktop and point to any text file

  9. Rightclick it and point to Open With - Other program.

  10. If You see both gedit and it's copy the configuration is finished. If not press "Show other program" and open the file with gedit copy.

  11. Repeat 9 and 10 opening by gedit not by copy.

Now You can open file using both modes using Rightclick - Open With - Other program.

Tested by Ubuntu 13.04 X64

share|improve this answer

In my installation of Ubuntu 14.10, once gedit is opened, right click on the launcher icon will display a selection list. The first entry in the list is, "Open a New Window".

That works for what I need.

share|improve this answer

To do it in the command line just add the following line to you ~/.bashrc

alias gedit="gedit --new-window"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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