AnswerBun.com

How to turn off alignment-indent after line continuation in Shell-script mode?

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?

Emacs Asked by Malvineous on January 1, 2021

1 Answers

One Answer

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+)

Answered by user13771 on January 1, 2021

Add your own answers!

Related Questions

How to check if a customize group exists in Emacs Lisp code?

1  Asked on September 2, 2021 by prouleau

 

encrypted password file with emacs & gpg

1  Asked on September 2, 2021 by user313032

 

How to pass an optional agrument to kill-emacs?

1  Asked on September 2, 2021 by ianinini

 

Tramp can’t connect – cannot find ssh

0  Asked on September 2, 2021 by n1k31t4

     

Emacs insane CPU load caused by org-superstar-mode

2  Asked on September 2, 2021 by mor3dr3ad

   

What ASCII character is C-q C-E?

1  Asked on September 2, 2021

   

M-x man: Can’t find the %s manpage caused by loading helm

0  Asked on September 2, 2021 by wdkrnls

   

Can the ring data structure really be rotated?

1  Asked on September 2, 2021

 

How do I compose an email using Emacs’ keybindings?

0  Asked on September 2, 2021 by user81065

 

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved.