簡體   English   中英

在haskell-indentation模式下自定義縮進寬度

[英]Customize indentation width in haskell-indentation mode

我目前正在使用Emacs作為我開發Haskell代碼的主要IDE,到目前為止我真的很滿意。 但目前我無法弄清楚一個小細節,即如何自定義縮進寬度為4而不是2。

目前我已經在haskell-mode打開了haskell-indentation ,但我無法弄清楚我必須設置哪個變量來自定義縮進寬度。 到目前為止,我已經嘗試設置'(haskell-indent-spaces 4)但這似乎沒有任何影響......

請提前獲取任何幫助!

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

所有這些都是自定義變量,因此您可以執行Mx 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)
 )

基於haskell-indentation 的來源 ,它看起來像2在文件中是硬編碼的,所以你必須手動編輯它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM