reddit / emacs

Strange tab width behavior in plaintext file: tab-width is 2, but first TAB inserts 4 spaces (while subsequent TABs insert 2 each)

snailiens ยท 2022-11-29 00:39
In plaintext files, I am getting 4 spaces inserted when I hit `Tab`, but ONLY for the first level of indentation. Each subsequent `Tab` inserts 2 spaces. I expect each time I hit `Tab` to have the same number of spaces inserted (if I `describe-variable tab-width`, it is 2). Any ideas why the first `Tab` inserts FOUR spaces instead of two? When searching for answers to this issue, other people mention separate variables such as `js-indent-level`, `c-basic-offset`, etc. But I am seeing this issue in plaintext, so I'm not sure what corresponding variable might make sense here? Thanks!