I am currently using Emacs as my primary IDE for developing Haskell code and I am really satisfied so far. But at the moment I can't figure out one little detail, namely how to customize the indentation width to be 4 instead of 2.
Currently I have turned on the haskell-indentation
in haskell-mode
, but I can't figure out what variable I have to set to customize the indentation width.
So far I have tried to set '(haskell-indent-spaces 4)
but this doesn't seem to have any effect at all...
Thx in advance for any help!
haskell-indentation-mode
offers a couple of knobs you can turn to customize indentation offsets:
haskell-indentation-layout-offset
haskell-indentation-starter-offset
haskell-indentation-left-offset
haskell-indentation-ifte-offset
haskell-indentation-where-pre-offset
haskell-indentation-where-post-offset
All of those are customization variables so you can do M-x customize-option RET
and customize any of those, or if you prefer programatically:
(custom-set-variables
;; Customization related to indentation.
'(haskell-indentation-layout-offset 4)
'(haskell-indentation-starter-offset 4)
'(haskell-indentation-left-offset 4)
'(haskell-indentation-where-pre-offset 4)
'(haskell-indentation-where-post-offset 4)
)
Based on the source of haskell-indentation
, it looks like 2
is hardcoded in the file so you'll have to edit it manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With