0

If typed in sh-mode the closing brace is not auto-indented:

function()
{
    }

If typed in c-mode the closing brace is auto-indented when inserted:

function()
{
}

The exact keystrokes are: f u n c t i o n ( ) ENT { ENT }.

How can I change this behavior to match c-mode?

young_souvlaki
  • 526
  • 2
  • 13
  • 1
    In `c-mode` these auto-indented feature is completed by `c-electric-brace` (specifically, `c-cleanup-list`), I'm not sure whether this is easy to adapt in `sh-mode` but I am afraid not. I suggest to use `electric-pair-mode`, and when you press enter, the indent is correctly both `sh-mode` and `c-mode`. – Tianshu Wang May 28 '22 at 04:56
  • Yes it does align if I `ENT` after, but that's an extra sequence I'd rather not do. – young_souvlaki May 29 '22 at 13:20

0 Answers0