Personal tools

Emacs/Formatting

From HaskellWiki

< Emacs(Difference between revisions)
Jump to: navigation, search
(Added description about how to use stylish.)
 
m (On Save)
 
(4 intermediate revisions by one user not shown)
Line 3: Line 3:
 
= Stylish Haskell =
 
= Stylish Haskell =
   
To use [https://github.com/jaspervdj/stylish-haskell Stylish Haskell] on your Emacs before every save, use <code>haskell-mode-save-buffer</code>. It is recommended to rebind <code>C-x C-s</code> in haskell-mode to this. Add the following in your <code>haskell-mode-hook</code>.
+
Use <code>M-x haskell-mode-stylish-buffer</code> to call [https://github.com/jaspervdj/stylish-haskell stylish-haskell] on the current buffer.
   
(define-key haskell-mode-map (kbd "C-x C-s") 'haskell-mode-save-buffer)
+
== On Save ==
   
To enable Stylish Haskell, pop the following somewhere in your Emacs configuration:
+
To call it for every save, [[Emacs/Keybindings_and_simple_usage#Rebind_C-x_C-s|make sure you have C-x C-s rebound to haskell-mode-save-buffer]], and then pop the following somewhere in your Emacs configuration:
   
 
(setq haskell-stylish-on-save t)
 
(setq haskell-stylish-on-save t)

Latest revision as of 18:58, 28 May 2012


[edit] 1 Stylish Haskell

Use M-x haskell-mode-stylish-buffer to call stylish-haskell on the current buffer.

[edit] 1.1 On Save

To call it for every save, make sure you have C-x C-s rebound to haskell-mode-save-buffer, and then pop the following somewhere in your Emacs configuration:

(setq haskell-stylish-on-save t)

Or in your custom set variables:

(custom-set-variables '(haskell-stylish-on-save t))

Or you can M-x customize-group haskell and pretend none of this exists!