8

In Shell-script[sh] mode, Emacs defaults to this style of indentation:

/this/is/an/example/command/broken/over_multiple_lines which \
                                                       causes \
                                                       an \
                                                       annoying \
                                                       indentation

I would like to change this so that each line is indented by only a single tab further than the original line:

/this/is/another example \
  which is indented \
  by a single tab \
  shown here \
  as two spaces

This is what the relevant section of my init.el says I have customised:

 '(sh-backslash-align t)
 '(sh-basic-offset 2)
 '(sh-indent-after-continuation nil)
 '(sh-indent-for-continuation 0)
 '(sh-indentation 2))

What variable am I missing to change the alignment indent to a single-tab indent?

Malvineous
  • 265
  • 1
  • 8
  • You seem to be looking for the default behavior. Try bisecting your init file for the faulty setting. For the record, with these values for the 5 variables, I get no indentation at all after the continuation. – T. Verron Oct 25 '16 at 12:59

1 Answers1

3

Open a file in shell-script-mode, run M-x customize-variable RET sh-indent-after-continuation, and see if you can set it to always. (This seems to be a relatively new option, Emacs 25.1+)

Chakravarthy Raghunandan
  • 3,132
  • 2
  • 18
  • 42
user13771
  • 31
  • 2