pull/172/merge
Denis Korzunov 2018-08-11 11:32:38 +00:00 committed by GitHub
commit 5c5121ac9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 4 deletions

View File

@ -111,6 +111,24 @@ log the size of the input, but _not_ the full input/output of requests.)
brittany built in.
#### Atom
[Atom Beautify](https://atom.io/packages/atom-beautify) supports brittany as a formatter for Haskell. Since the default formatter is set to hindent, you will need to change this setting to brittany, after installing the extension.
#### Emacs
The following is an easy way to use `brittany` in Emacs
```
(defun brittany-format-buffer-file ()
"run brittany command on the current file and revert the buffer"
(interactive)
(save-buffer)
(shell-command
(format "brittany %s --write-mode=inplace"
(shell-quote-argument (buffer-file-name)))
nil
shell-command-default-error-buffer)
(revert-buffer t t t))
(add-hook 'haskell-mode-hook
(lambda ()
(local-set-key (kbd "C-c C-f") 'brittany-format-buffer-file)))
```
# Usage