1
Fork 0

Set up haskell-tools.nvim

This commit is contained in:
Matei Adriel 2023-09-22 21:08:11 +03:00
parent c8d7224dc9
commit 346d1b78d9
No known key found for this signature in database
10 changed files with 128 additions and 95 deletions

View file

@ -1,6 +1,12 @@
# shell containing the tools i most commonly use for haskell work!
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [ ghc hpack stack cabal-install ];
buildInputs = with pkgs; [
ghc
hpack
stack
cabal-install
haskellPackages.implicit-hie # Automatically generate hie.yaml!
];
}

View file

@ -10,9 +10,7 @@
"library": {
"enabled": true,
"types": true,
"plugins": [
"scrap"
],
"plugins": true,
"runtime": true
}
}

View file

@ -18,6 +18,7 @@
"github-actions-yaml.vim": { "branch": "master", "commit": "f2f16243447cea174daa6b4a9ffd3ff9213814ef" },
"gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" },
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
"haskell-tools.nvim": { "branch": "master", "commit": "b19df600da8ef5fb4fb280815415ebd2a4228f0f" },
"hydra.nvim": { "branch": "master", "commit": "3ced42c0b6a6c85583ff0f221635a7f4c1ab0dd0" },
"hyprland-vim-syntax": { "branch": "main", "commit": "8488a24b50882da969979103b4d668c70e7995b9" },
"idris2-nvim": { "branch": "main", "commit": "3a2b4d2b5ffeab9e47298456c59c31b4e1ddebc9" },
@ -64,7 +65,6 @@
"typst.vim": { "branch": "main", "commit": "6a99324a138c2da69589a8ab2e49375774e43d77" },
"undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" },
"venn.nvim": { "branch": "main", "commit": "c114563960b8fb1197695d42798d1f3e7190b798" },
"vim-abolish": { "branch": "master", "commit": "cb3dcb220262777082f63972298d57ef9e9455ec" },
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
"vim-teal": { "branch": "master", "commit": "d2aa107b257879e774680792a2aebaf9cd5742e0" },
"vim-tmux-navigator": { "branch": "master", "commit": "cdd66d6a37d991bba7997d593586fc51a5b37aa8" },

View file

@ -0,0 +1,24 @@
local lspconfig = require("my.plugins.lspconfig")
local M = {
"mrcjkb/haskell-tools.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
version = "^2",
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
}
function M.config()
vim.g.haskell_tools = {
hls = {
on_attach = lspconfig.on_attach,
},
tools = {
hover = {
enable = false,
},
},
}
end
return M

View file

@ -97,8 +97,10 @@ end
-- {{{ General server config
---@type lspconfig.options
---@diagnostic disable-next-line: missing-fields
local servers = {
-- {{{ Typescript
---@diagnostic disable-next-line: missing-fields
tsserver = {
on_attach = function(client, bufnr)
-- We handle formatting using null-ls and prettierd
@ -110,6 +112,7 @@ local servers = {
-- {{{ Purescript
purescriptls = {
settings = {
---@diagnostic disable-next-line: missing-fields
purescript = {
censorWarnings = { "UnusedName", "ShadowedName", "UserDefinedWarning" },
formatter = "purs-tidy",
@ -117,16 +120,6 @@ local servers = {
},
},
-- }}}
-- {{{ Haskell
hls = {
settings = {
haskell = {
-- set formatter
formattingProvider = "fourmolu",
},
},
},
-- }}}
-- {{{ Lua
lua_ls = {
cmd = {
@ -134,6 +127,7 @@ local servers = {
"--logpath=/home/adrielus/.local/share/lua-language-server/log",
},
settings = {
---@diagnostic disable-next-line: missing-fields
Lua = {
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
@ -174,10 +168,13 @@ local servers = {
nil_ls = {},
nixd = {},
-- }}}
---@diagnostic disable-next-line: missing-fields
cssls = {},
---@diagnostic disable-next-line: missing-fields
jsonls = {},
dhall_lsp_server = {},
typst_lsp = {},
---@diagnostic disable-next-line: missing-fields
elmls = {},
-- {{{ Inactive
-- pylsp = {},

View file

@ -2,7 +2,7 @@ local env = require("my.helpers.env")
local M = {
"L3MON4D3/LuaSnip", -- snippeting engine
cond = env.vscode.not_active()
cond = env.vscode.not_active(),
}
local function reload()

View file

@ -14,6 +14,13 @@
# Direnv
".direnv"
".envrc"
# Haskell
# NOTE: THIS IS A BAD IDEA
# I need to figure out a better way (this is simply here because
# a project I contribute to doesn't gitignore this file, nor does
# it have it commited).
"hie.yaml"
];
aliases = {

View file

@ -51,6 +51,7 @@ let
libstdcxx5 # Required by treesitter aparently
python310Packages.jupytext # Convert between jupyter notebooks and python files
graphviz # For rust crate graph
haskellPackages.hoogle # For haskell search
# Preview
zathura # Pdf reader

View file

@ -48,7 +48,7 @@
let
blacklisted = [
"twitter.com"
"www.reddit.com"
# "www.reddit.com"
# "minesweeper.online"
];
blacklist = lib.concatStringsSep "\n" (lib.forEach blacklisted (host: "127.0.0.1 ${host}"));