我目前正在使用Emacs作为我开发Haskell代码的主要IDE,到目前为止我非常满意。但是目前我还不知道一个细节,就是如何定制缩进宽度为4而不是2。
目前,我已经在haskell-mode中打开了haskell-mode,但我不知道必须设置哪些变量来自定义缩进宽度。到目前为止,我已经尝试设置'(haskell-indent-spaces 4),但这似乎没有任何效果.
请提前提供任何帮助!
发布于 2015-09-07 09:52:27
基于来源 of haskell-indentation,看起来2在文件中是硬编码的,所以您必须手动编辑它。
发布于 2015-09-16 14:44:03
haskell-indentation-mode提供了几个可以用来定制缩进偏移量的旋钮:
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所有这些都是自定义变量,因此您可以执行M-x customize-option RET并自定义其中的任何一个,或者如果您喜欢编程的话:
(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)
)https://stackoverflow.com/questions/32412063
复制相似问题