Haskell
info
You can enable the extra with the :LazyExtras
command.
Plugins marked as optional will only be configured if they are installed.
Below you can find a list of included plugins and their default settings.
caution
You don't need to copy the default settings to your config. They are only shown here for reference.
nvim-treesitter
Add Haskell to treesitter
- Options
- Full Spec
opts = { ensure_installed = { "haskell" } }
{
"nvim-treesitter/nvim-treesitter",
opts = { ensure_installed = { "haskell" } },
}
haskell-tools.nvim
- Options
- Full Spec
opts = nil
{
"mrcjkb/haskell-tools.nvim",
version = false,
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
keys = {
{
"<localleader>e",
"<cmd>HlsEvalAll<cr>",
ft = "haskell",
desc = "Evaluate All",
},
{
"<localleader>h",
function()
require("haskell-tools").hoogle.hoogle_signature()
end,
ft = "haskell",
desc = "Hoogle Signature",
},
{
"<localleader>r",
function()
require("haskell-tools").repl.toggle()
end,
ft = "haskell",
desc = "REPL (Package)",
},
{
"<localleader>R",
function()
require("haskell-tools").repl.toggle(vim.api.nvim_buf_get_name(0))
end,
ft = "haskell",
desc = "REPL (Buffer)",
},
},
}
mason.nvim
- Options
- Full Spec
opts = { ensure_installed = { "haskell-language-server" } }
{
"mason-org/mason.nvim",
opts = { ensure_installed = { "haskell-language-server" } },
}
mason.nvim
- Options
- Full Spec
opts = { ensure_installed = { "haskell-debug-adapter" } }
{
"mason-org/mason.nvim",
opts = { ensure_installed = { "haskell-debug-adapter" } },
}
neotest-haskell
- Options
- Full Spec
opts = nil
{ "mrcjkb/neotest-haskell" }
haskell-snippets.nvim
- Options
- Full Spec
opts = {}
{
"mrcjkb/haskell-snippets.nvim",
dependencies = { "L3MON4D3/LuaSnip" },
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
config = function()
local haskell_snippets = require("haskell-snippets").all
require("luasnip").add_snippets("haskell", haskell_snippets, { key = "haskell" })
end,
}
LuaSnip
- Options
- Full Spec
opts = nil
{ "L3MON4D3/LuaSnip" }
telescope_hoogle
- Options
- Full Spec
opts = function()
LazyVim.on_load("telescope.nvim", function()
require("telescope").load_extension("ht")
end)
end
{
"luc-tielen/telescope_hoogle",
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
opts = function()
LazyVim.on_load("telescope.nvim", function()
require("telescope").load_extension("ht")
end)
end,
keys = {
{
"<localleader>H",
"<cmd>Telescope hoogle<cr>",
ft = "haskell",
desc = "Hoogle",
},
},
}
nvim-lspconfig
Make sure lspconfig doesn't start hls, as it conflicts with haskell-tools
- Options
- Full Spec
opts = {
setup = {
hls = function()
return true
end,
},
}
{
"neovim/nvim-lspconfig",
opts = {
setup = {
hls = function()
return true
end,
},
},
}
nvim-dap (optional)
- Options
- Full Spec
opts = nil
{
"mfussenegger/nvim-dap",
optional = true,
dependencies = {
{
"mason-org/mason.nvim",
opts = { ensure_installed = { "haskell-debug-adapter" } },
},
},
}
neotest (optional)
- Options
- Full Spec
opts = {
adapters = {
["neotest-haskell"] = {},
},
}
{
"nvim-neotest/neotest",
optional = true,
dependencies = {
{ "mrcjkb/neotest-haskell" },
},
opts = {
adapters = {
["neotest-haskell"] = {},
},
},
}
telescope.nvim (optional)
- Options
- Full Spec
opts = nil
{
"nvim-telescope/telescope.nvim",
optional = true,
specs = {
{
"luc-tielen/telescope_hoogle",
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
opts = function()
LazyVim.on_load("telescope.nvim", function()
require("telescope").load_extension("ht")
end)
end,
keys = {
{
"<localleader>H",
"<cmd>Telescope hoogle<cr>",
ft = "haskell",
desc = "Hoogle",
},
},
},
},
}
conform.nvim (optional)
- Options
- Full Spec
opts = {
formatters_by_ft = {
haskell = { "fourmolu" },
cabal = { "cabal_fmt" },
},
}
{
"stevearc/conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
haskell = { "fourmolu" },
cabal = { "cabal_fmt" },
},
},
}
nvim-lint (optional)
- Options
- Full Spec
opts = {
linters_by_ft = {
haskell = { "hlint" },
},
}
{
"mfussenegger/nvim-lint",
optional = true,
opts = {
linters_by_ft = {
haskell = { "hlint" },
},
},
}