Skip to content

My collection of Haskell snippets for LuaSnip. Powered by tree-sitter and LSP.

License

Notifications You must be signed in to change notification settings

mrcjkb/haskell-snippets.nvim

Repository files navigation


haskell-snippets.nvim

Report Bug

My collection of Haskell snippets for LuaSnip.
Powered by tree-sitter and LSP.

🦥

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:

About

My collection of Haskell snippets for LuaSnip. Powered by tree-sitter and LSP.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published