I set the tab-width for Golang to 2 using the following:
(add-hook 'go-mode-hook
(lambda ()
(setq-default indent-tabs-mode 1)
(setq-default tab-width 2)))
And when I check the tab-width
variable, it shows:
tab-width is a variable defined in ‘C source code’.
Its value is 8
Local in buffer plugin.go; global value is 2
Automatically becomes buffer-local when set.
This variable is safe as a file local variable if its value
satisfies the predicate ‘integerp’.
But when I open any .go file, the tab width is still 8. Why?