Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 16861  / 1 Year ago, wed, november 23, 2022, 1:04:26

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


More From » gedit

 Answers
0

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]
Type=Application
Name=gedit_alternative
Comment=gedit standalone
Exec=/usr/bin/gedit -s %U
Terminal=false
GenericName=


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]
text/x-log=geditspecial.desktop
text/plain=geditspecial.desktop


and



[Added Associations]
text/x-log=geditspecial.desktop;
text/plain=geditspecial.desktop;


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


[#34198] Thursday, November 24, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
eighethod

Total Points: 358
Total Questions: 112
Total Answers: 119

Location: Cayman Islands
Member since Fri, Mar 4, 2022
2 Years ago
;