Skip to content
This repository was archived by the owner on Dec 26, 2020. It is now read-only.

Latest commit

 

History

History
67 lines (45 loc) · 1.84 KB

README.md

File metadata and controls

67 lines (45 loc) · 1.84 KB

Update: This plugin may still work, but I have opted to use Neoformat instead. Thus, I have archived this repository.


vim-brittany

Integrates with brittany so every time you save a Haskell source file it gets automatically prettified.

Simply using :%!brittany replaces your whole source file with an error message from brittany when you happen to have a syntax error in your code. This plugin manages that annoyance.

Note: If you prefer hindent use vim-hindent instead. Note: If you prefer stylish-haskell use vim-stylishask instead.

Installation

Compatible with Vundle, Pathogen, Vim-plug.

Usage

By default, vim-brittany will format your code automatically when saving a Haskell source file, but you can use the :Brittany command at any time to format the current file.

To apply brittany on a range, either write the range manually or visually select the desired code and then invoke :Brittany.

Use :BrittanyEnable, :BrittanyDisable, :BrittanyToggle to enable, disable, or toggle running brittany on save.

Configuration

Trigger brittany when saving (default = 1):

g:brittany_on_save = 1

Number of spaces per indentation (default = '', uses brittany default of 2):

g:brittany_indent = 2

Max line length (default = '', uses brittany default of 80):

g:brittany_columns = 100

Specify the path to the brittany executable (for example if you installed brittany with stack build --copy-compiler-tool brittany)

g:brittany_command = "stack exec -- brittany"

Credits

Credit for this goes to alx741, as this is essentially a search-and-replace of vim-hindent.