首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在haskell-缩进模式下自定义缩进宽度

在haskell-缩进模式下自定义缩进宽度
EN

Stack Overflow用户
提问于 2015-09-05 10:35:10
回答 2查看 815关注 0票数 4

我目前正在使用Emacs作为我开发Haskell代码的主要IDE,到目前为止我非常满意。但是目前我还不知道一个细节,就是如何定制缩进宽度为4而不是2。

目前,我已经在haskell-mode中打开了haskell-mode,但我不知道必须设置哪些变量来自定义缩进宽度。到目前为止,我已经尝试设置'(haskell-indent-spaces 4),但这似乎没有任何效果.

请提前提供任何帮助!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-09-07 09:52:27

基于来源 of haskell-indentation,看起来2在文件中是硬编码的,所以您必须手动编辑它。

票数 4
EN

Stack Overflow用户

发布于 2015-09-16 14:44:03

haskell-indentation-mode提供了几个可以用来定制缩进偏移量的旋钮:

代码语言:javascript
复制
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并自定义其中的任何一个,或者如果您喜欢编程的话:

代码语言:javascript
复制
(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)
 )
票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32412063

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档