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?
Tab key == 4 spaces and auto-indent after curly braces in Vim.
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).
-T <#cols>, --tabsize=<#cols> For four spaces, the appropriate command would therefore be nano -ET4 .
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With