22

Everytime I open a file in gedit, I have to change again the tab with from 8 to 4, as I prefer it.

Is there any configuration file where I can make 4 the default tab width?

Bruno Pereira
  • 73,643
The Student
  • 11,926

3 Answers3

16

In gedit's menu, go to Edit -> Preferences. When the "gedit Preferences" window pops up, click on the "Editor" tab, and you'll be able to change the Tab Width setting.

waltinator
  • 36,399
  • 1
    This does not apply to the latest versions of Gedit with GNOME 3. – Flimm May 30 '19 at 13:21
  • 1
    @Flimm: In Gedit in Gnome 3, you can find the preferences dialog by clicking on the top bar of the screen, next to "Activities". – Raoul Steffen Aug 09 '19 at 07:53
  • @RaoulSteffen I don't think there's a Tab Width setting though. – Flimm Aug 09 '19 at 09:25
  • @Flimm: There is for me. Menu > Preferences > Editor > Tab Stops > Tab width. Looks much like the screenshot jrg posted in his answer. I have got Gedit 3.28.1 (as it came with Ubuntu 18.04). – Raoul Steffen Aug 18 '19 at 13:49
12

For GNOME 3, go here

GNOME 2

Go to Edit > Preferences in gedit. Then, switch to the Editor tab:

enter image description here

Edit those preferences to your hearts content.

(Please excuse the ugly GTK theme, the latest Oneiric updates broke my XFCE themes)

jrg
  • 60,611
9

Open Terminal and type:

gsettings set org.gnome.gedit.preferences.editor tabs-size 4
Shubham
  • 275