/haskell-format-import

A neovim plugin that formats your Haskell import statements, itself written in Haskell!

Primary LanguageHaskell

haskell-format-import

Build Status

This is a neovim plugin that formats your Haskell import statements, and it is itself written in Haskell!

How 🔥 🔥 🔥 is that?!

Features

  • Sorts alphabetically
  • Aligns on "qualified"
  • Aligns on "as"
  • Aligns on "()"

Install

  • You will need to install nvim-hs.
  • Then run make

Then add the following code to your ~/.config/nvim/nvim.hs file,

..

import qualified HaskellFormatImport as HFI

..

main = do
  neovim defaultConfig
    { plugins = plugins defaultConfig ++ [ .., HFI.plugin ]
    }

Usage

This plugin exposes the HaskellFormatImport command which you could map some keybinding to, or invoke directly.

Tests

To run the tests you can run stack test