Skip to content
This repository has been archived by the owner on Dec 26, 2020. It is now read-only.
/ vim-brittany Public archive
forked from alx741/vim-hindent

Vim Haskell Brittany integration plugin

Notifications You must be signed in to change notification settings

btjanaka-vim/vim-brittany

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 

Repository files navigation

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.

About

Vim Haskell Brittany integration plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 100.0%