59

This is incredibly weird. I don't see "preferences" in any of my gedit menus. I'm running Version 3.8.3. All I want to do is show line numbers, but I can't do that without preferences.

Where the heck are they hiding?

note: I did remove indicator-appmenus because I dislike having the menus detached from the window.

2015 Update: somehow this is being flagged as a dupe of Enable line numbers in gedit which is a little confusing. The solution is the same but the questions are different.

muru
  • 193,181
  • 53
  • 473
  • 722
Amanda
  • 9,051
  • 17
  • 53
  • 98
  • Does your gEdit have a gear icon in the main window toolbar area? – dobey Nov 10 '13 at 17:14
  • 1
    @dobey no, it doesn't. – Amanda Nov 10 '13 at 17:21
  • Eeesh. @vasa1 It does. Editing my Q – Amanda Nov 10 '13 at 17:33
  • 4
    iwould ck here as the issue was no preference menu option http://askubuntu.com/questions/364117/enable-line-numbers-in-gedit/364763#364763 – doug Nov 10 '13 at 18:22
  • @doug running `gsettings set org.gnome.settings-daemon.plugins.xsettings overrides '@a{sv} {"Gtk/ShellShowsAppMenu": }'` as described there doesn't do anything for me. – Amanda Nov 10 '13 at 22:40
  • 1
    What did work was explicitly setting line numbers w/ ` gsettings set org.gnome.gedit.preferences.editor display-line-numbers true ` – Amanda Nov 10 '13 at 23:28
  • @user5950 I accepted an answer to this two years ago. I am not even running the same version of gedit anymore. – Amanda Sep 11 '15 at 22:21

12 Answers12

51

if you are using GNOME 3, you can access the preferences via the top menu.

you should have "activities" on the top left corner of your screen. on the right side of activities, you will have gedit. click on it, and you should see the preferences.

Buğra Koç
  • 627
  • 5
  • 3
  • I do see preferences, but clicking it doesn't bring up anything. – Irfan Jan 29 '14 at 12:14
  • 1
    @Power-Inside if you've got a top menu but the "preferences" menu item isn't doing anything, you probably want to start a new question. – Amanda Jan 29 '14 at 13:57
  • 2
    ew! yet another reason for me not to return to gnome. why move *preferences* to a mac style location?? absurd – jozxyqk Feb 28 '15 at 06:22
  • It helps me. Thank you! I found a lot of tips for accessing through "edit" menu, however I couldn't find on my Ubuntu GNOME 16.04. I couldn't imagine that it moved onto a global menu. – hata Aug 05 '16 at 15:17
  • 3
    launching it with sudo the preferences are in the standard three-bar, and not the top bar, and preferences are locked (gedit 3.30 under Arch) – user1708042 Sep 27 '18 at 21:08
  • @user1708042 You can have `sudo -H gedit` inherit user preferences though: https://askubuntu.com/questions/270006/why-should-users-never-use-normal-sudo-to-start-graphical-applications/1047413#1047413 – WinEunuuchs2Unix Sep 29 '18 at 16:59
  • "top menu" is the bit on the gnome desktop top bar that says "Text Editor" or "gedit" wnen gedit is focussed – Jasen Jul 28 '20 at 02:32
  • I don't get this mad dash by designers to remove the menu. *Leave the menu alone. Its useful* – Olumide Dec 21 '20 at 12:17
34

I'm not sure how to get preferences back in your menus, but you can use gsettings to display line numbers. Enter this command into the terminal:

gsettings set org.gnome.gedit.preferences.editor display-line-numbers true

In case you need to change other settings for gedit, you can use this command to find quite a few that are available: (thanks to this answer)

gsettings list-recursively | grep -i gedit
OSE
  • 911
  • 4
  • 11
  • 21
  • 19
    cannot believe why gedit became so hard to use these days.... – BufBills May 16 '14 at 03:28
  • 3
    +1 because this answer is valid for Gedit in GNOME 3.12 and probably for newer releases also. Gedit in newer releases doesn't seem to have the preferences dialog [as described here](https://blogs.gnome.org/nacho/2014/01/15/gedit-has-a-new-face/). –  Jan 12 '16 at 18:03
19

To get the preferences entry back to the edit menu perform the following command in a terminal:

gsettings set org.gnome.settings-daemon.plugins.xsettings overrides '@a{sv} {"Gtk/ShellShowsAppMenu": <int32 0>}'

The problem results from Gnome3 putting the preferences menu entry to the top menu.

Naomi Yoshida
  • 299
  • 1
  • 8
user5950
  • 6,056
  • 11
  • 59
  • 83
  • 1
    Thank you, this was the only solution that worked for me (using CentOS but solution is the same). Can't believe this is hidden by default!! – crobicha May 25 '16 at 15:10
16

Just type Alt+E, then again E when you are in gedit. A new window called "gedit Preferences" should appear.

gedit preferences

Radu Rădeanu
  • 166,822
  • 48
  • 327
  • 400
4

Faced similar problem...got the preference option in the activities bar in the left hand corner..I am using gedit v3.22.1

gedit preference setting

enter image description here

MatsK
  • 916
  • 6
  • 18
3

In my desktop, I found it here: enter image description here

Mostafa
  • 171
  • 3
  • That is the best answer for me! No need to use cli or disable ui extensions. Just right-click gedit icon in panel - and you got it! You just saved my day, thanks a lot! – thybzi May 20 '20 at 09:45
3

You may need to use tweak tool to turn off temporarily some of the common extensions normal people now use to make gnome 3 usable on a desktop. For me, I had to turn off the taskbar and applications menu extensions. Then one can use the method described by Buğra Koç above.

This means the easy switching on and off of line numbers and word wrap in gedit is gone.

If you don't need text highlighting Leafpad is a good replacement for gedit. It looks like the old gedit:

sudo apt-get install leafpad
varanasib
  • 41
  • 1
1

You can access the preference settings of any app by installing dconf-editor:

Debian derivatives:

sudo apt install dconf-editor  

Redhat derivatives:

sudo yum install dconf-editor # for Fedora replace yum with dnf

Then open dconf-editor

dconf-editor &>/dev/null &  

Click the search icon and type gedit or follow this path: org/gnome/gedit/preference/editor/display-line-number

Turn off the default value and make the custom value true

karel
  • 110,292
  • 102
  • 269
  • 299
finn
  • 191
  • 2
0

Some preferences, such as display line numbers can be activated from the options in the gedit bottom bar(right side).

0

1 Click the hamburger icon (three bold horizontal lines) in the upper right part of the window)

2 Select preferences

Screenshot

Se Bo
  • 143
  • 1
  • 2
  • 7
  • Your answer does not add anymore or different info then is already in the question. – David Apr 05 '23 at 14:43
  • Thank you for helpful comment. Regretfully neither the question nor answers mention hamburger menu. @David there a snapshot by Mostafa which includes the hamburger icon, yet it suggests a different solution which might not work for some users – Se Bo Apr 05 '23 at 19:34
0

The preferences are under edit at the bottom of the list. enter image description here

Try to get the menu-bar back, or if that fails remove it entirely and install a fresh new instance of gedit, mine is 3.10.4, so yours is a bit old!

Ken Mollerup
  • 1,265
  • 1
  • 11
  • 22
0

I know this is an old thread, but I just ran into the same problem. In the end, I figured out that it was because I was still logged in as the superuser. Once I logged out of the terminal and reopened the terminal, everything went back to normal.

Just thought I'd throw that out there in case anyone else hits the same problem.

If you're seeing a # instead of a $ at your command line, this is likely why you can't see your defaults.

DocGil
  • 1
  • 2