Closed bgits closed 3 years ago
Since solidity mode is just another emacs language mode you can customize it like any other language mode for things like indentation: https://www.gnu.org/software/emacs/manual/html_node/efaq/Customizing-C-and-C_002b_002b-indentation.html
Don't know if it helps, but my solidity configuration uses 2 indents, and looks like this
;; NB: Hitting C-c C-s on the line you want to indent will
;; indicate which syntax mode affects indentation (defun-block-intro, statement-block-intro, etc.)
(defun my-solidity-mode-hook ()
(c-set-offset 'defun-block-intro 2)
(c-set-offset 'statement-block-intro 2)
)
(add-hook 'solidity-mode-hook 'my-solidity-mode-hook)
Many solidity projects use 2 indents now and solidity-mode seems to default to 4. How can it be changed to 2?