Singular way to set tab width in Emacs

Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
In Emacs, is there a way to set all languages to use tab-width 2 as a default, or do you have to use this plethora of different instructions and variables for every single language?
(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
(setq-default sh-basic-offset 2)
(setq c-default-style "bsd"
c-basic-offset 2
css-indent-offset 2
js-indent-level 2)
(add-hook 'php-mode-hook '(lambda ()
(setq c-basic-offset 2)))
(add-hook 'ess-mode-hook '(lambda ()
(setq ess-fancy-comments nil)
(setq ess-indent-offset 2)))
emacs
add a comment |Â
up vote
2
down vote
favorite
In Emacs, is there a way to set all languages to use tab-width 2 as a default, or do you have to use this plethora of different instructions and variables for every single language?
(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
(setq-default sh-basic-offset 2)
(setq c-default-style "bsd"
c-basic-offset 2
css-indent-offset 2
js-indent-level 2)
(add-hook 'php-mode-hook '(lambda ()
(setq c-basic-offset 2)))
(add-hook 'ess-mode-hook '(lambda ()
(setq ess-fancy-comments nil)
(setq ess-indent-offset 2)))
emacs
First guess isESC-x customize-variable tab-width, second guess is(set-variable 'tab-width 2)in some generic hook, but I'm no emacs expert. Try emacs.stackexchange.com
â dirkt
Jan 6 at 16:50
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
In Emacs, is there a way to set all languages to use tab-width 2 as a default, or do you have to use this plethora of different instructions and variables for every single language?
(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
(setq-default sh-basic-offset 2)
(setq c-default-style "bsd"
c-basic-offset 2
css-indent-offset 2
js-indent-level 2)
(add-hook 'php-mode-hook '(lambda ()
(setq c-basic-offset 2)))
(add-hook 'ess-mode-hook '(lambda ()
(setq ess-fancy-comments nil)
(setq ess-indent-offset 2)))
emacs
In Emacs, is there a way to set all languages to use tab-width 2 as a default, or do you have to use this plethora of different instructions and variables for every single language?
(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
(setq-default sh-basic-offset 2)
(setq c-default-style "bsd"
c-basic-offset 2
css-indent-offset 2
js-indent-level 2)
(add-hook 'php-mode-hook '(lambda ()
(setq c-basic-offset 2)))
(add-hook 'ess-mode-hook '(lambda ()
(setq ess-fancy-comments nil)
(setq ess-indent-offset 2)))
emacs
asked Jan 5 at 20:26
forthrin
832921
832921
First guess isESC-x customize-variable tab-width, second guess is(set-variable 'tab-width 2)in some generic hook, but I'm no emacs expert. Try emacs.stackexchange.com
â dirkt
Jan 6 at 16:50
add a comment |Â
First guess isESC-x customize-variable tab-width, second guess is(set-variable 'tab-width 2)in some generic hook, but I'm no emacs expert. Try emacs.stackexchange.com
â dirkt
Jan 6 at 16:50
First guess is
ESC-x customize-variable tab-width, second guess is (set-variable 'tab-width 2) in some generic hook, but I'm no emacs expert. Try emacs.stackexchange.comâ dirkt
Jan 6 at 16:50
First guess is
ESC-x customize-variable tab-width, second guess is (set-variable 'tab-width 2) in some generic hook, but I'm no emacs expert. Try emacs.stackexchange.comâ dirkt
Jan 6 at 16:50
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f415074%2fsingular-way-to-set-tab-width-in-emacs%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
First guess is
ESC-x customize-variable tab-width, second guess is(set-variable 'tab-width 2)in some generic hook, but I'm no emacs expert. Try emacs.stackexchange.comâ dirkt
Jan 6 at 16:50