mrcjkb/haskell-snippets.nvim

github github
snippet
stars 29
issues 4
subscribers 2
forks 1
CREATED

2023-05-26

UPDATED

2 months ago


Neovim Lua Haskell Nix

GPL2 License Issues Build Status LuaRocks

Quick Links

Installation

Use luarocks or your favourite plugin manager.

Required

Optional

Quick setup

Add the following to your LuaSnip setup.

local ls = require('luasnip')
ls.setup {
  -- Add your LuaSnip config
}
local haskell_snippets = require('haskell-snippets').all
ls.add_snippets('haskell', haskell_snippets, { key = 'haskell' })

[!NOTE]

See also :h haskell-snippets

Snippets

[!NOTE]

  • The recording software ttyrec sometimes has some visual glitches.
  • Many snippets provided by this plugin use choice nodes recursively.

Pragmas

haskell-snippets.pragmas.prag

  • Trigger: prag

tty

haskell-snippets.pragmas.lang

  • Trigger: lang

tty

haskell-snippets.pragmas.discover

  • Trigger: discover

tty

haskell-snippets.pragmas.nowarn

  • Trigger: nowarn

tty

Module and imports

haskell-snippets.module.mod

  • Trigger: mod

tty

haskell-snippets.module.qual

  • Trigger: qual

tty

haskell-snippets.module.impc

  • Trigger: impc
  • Requires a tree-sitter parser for Haskell.

tty

haskell-snippets.module.qualc

  • Trigger: qualc
  • Requires a tree-sitter parser for Haskell.

tty

Data and typeclasses

haskell-snippets.data.adt

  • Trigger: adt

tty

haskell-snippets.data.newtype

  • Trigger: new

tty

haskell-snippets.data.rec

  • Trigger: rec

tty

haskell-snippets.data.cls

  • Trigger: cls

tty

haskell-snippets.data.ins

  • Trigger: ins

tty

haskell-snippets.data.constraint

  • Trigger: =>

tty

Functions

haskell-snippets.functions.fn

  • Trigger: fn

tty

haskell-snippets.functions.func

  • Trigger: func

tty

haskell-snippets.functions.lambda

  • Trigger: \

tty

Expressions

haskell-snippets.expressions.if_expr

  • Trigger: if

tty

haskell-snippets.expressions.if_expr_multiline

  • Trigger: iff

tty

  • Trigger: case

tty

haskell-snippets.expressions.if_expr_multiway

  • Trigger: ifmw

tty

haskell-snippets.expressions.lambdacase

  • Trigger: \case

tty

QuasiQuotes

haskell-snippets.quasiquotes.qq

  • Trigger: qq

tty

haskell-snippets.quasiquotes.sql

  • Trigger: sql

tty

Contributing

All contributions are welcome! See CONTRIBUTING.md.

Recommendations

Here are some other plugins I recommend for Haskell development: