How to change tab from 8 to 4 spaces

Asked by jhd_cl

Can I or how do I change the tab from 8 to 4 spaces in gnome-terminal

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
nhasian (nhasian) said :
#1

when i press tab in terminal it auto completes. are you in some kind of text editor like vi, nano, emacs?

Revision history for this message
jhd_cl (clewis-jetheaddev) said :
#2

auto complete works fine. When I print a file using "more" the tabs are set at 8 spaces. I would like the default to be 4 spaces instead.

Revision history for this message
Koen (koen-beek) said :
#3

I don't know about any option in more for tabs but you could use less in stead of more (less is better than more)

man less says :

       -xn,... or --tabs=n,...
              Sets tab stops. If only one n is specified, tab stops are set
              at multiples of n. If multiple values separated by commas are
              specified, tab stops are set at those positions, and then con‐
              tinue with the same spacing as the last two. For example,
              -x9,17 will set tabs at positions 9, 17, 25, 33, etc. The
              default for n is 8.

Revision history for this message
jhd_cl (clewis-jetheaddev) said :
#4

Thanks. Maybe I can find that setting on all the apps I use.

The holy grail I was looking for was to change a system setting that would cause all of the apps to use a 4 space tab instead of an 8 space. That would include vim, less, more, cat, etc... This is a 4 space house not 8. ;-)

But if it doesn't exist I can live with it.

Revision history for this message
nhasian (nhasian) said :
#5

 Koen Beek said 42 minutes ago: (less is better than more)

hehe thats funny. its true but its funny.

Revision history for this message
laxaman (varunvyas89) said :
#6

I have just started learning python and there TABs are used for displaying blocks.. I really dont like the default TAB size of 8.. 4 is enough for me. Please tell me if there is a way. There must be something. Linux is customizable, so there should be a way.

Can you help with this problem?

Provide an answer of your own, or ask jhd_cl for more information if necessary.

To post a message you must log in.