Demonstration of the problem:
# starting point:
function hello_world {
_somecommand_ parameter '
| <--- point/cursor is here on step one
'
}
the next step (I take issue with):
function hello_world {
somecommand parameter '
TAB | <--- point/cursor is now here on step two
alligned right under the beginning of awk
.
that's not a multiple of four and it "skipped" several multiples.
'
}
the next step (what I actually wanted to happen):
function hello_world {
somecommand parameter '
TAB | <--- I want the cursor to be strictly just 4 spaces to the right of TAB
'
}
Legend:
|
== the cursor/point
TAB
== press the TAB key at that position
There seems to be some mode I'm not aware of that auto-aligns words vertically in some situations, where in fact I'd like my indentation to be predictable and strictly in multiples of whatever tabstop I have defined (I prefer four, and with no "skips").
How to achieve this?
tab-width
in the buffer in question? This is a buffer-local variable. Do you see the same thing if you start Emacs usingemacs -Q
(no init file)? If not, bisect your init file to find the culprit. – Drew Sep 27 '23 at 16:18TAB
bound to in the mode you're in? In programming modes it's typically bound to a command that indents according to the style defined for that mode - it doesn't indent a fixedtab-width
amount. – Drew Sep 27 '23 at 16:23