Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display tabs as 4 spaces in gnome-terminal

Actually gnome-terminal display tabs as 8 spaces, and this is very annoying when you cat files or view diffs, is there some way to change this permanently?

like image 871
Htechno Avatar asked Jan 05 '10 11:01

Htechno


People also ask

How do you set a tab to 4 spaces in vim?

Tab key == 4 spaces and auto-indent after curly braces in Vim.

How many spaces is a tab in Terminal?

In a computer, a horizontal tab is represented as a single non-printable character, ASCII value 9. Each tab character is translated by software to a variable-width spacing. Common default tab widths are four spaces (in a monospaced text document), or half an inch (in a word processor).

How do I change a tab from 4 to nano?

-T <#cols>, --tabsize=<#cols> For four spaces, the appropriate command would therefore be nano -ET4 .

How do I change the tab spacing in Ubuntu?

For example in vim - :set tabstop=4 . Or you could look into the man page for the expand command with man expand . Example of usage - expand -t 4 mytextfile. txt - this would convert the tab spacing when viewing a file from the default 8 to 4.


1 Answers

Instead of writing out an explicit list of tabstops, you can also use implicit intervals:

tabs -n

This will set tabstops to occur every n columns. For more information, check out the manpage for tabs at http://manpages.ubuntu.com/manpages/maverick/en/man1/tabs.1.html.

like image 173
Stephan Klein Avatar answered Sep 23 '22 07:09

Stephan Klein