From ff2f1032a25745e871e8073d849d25480843446f Mon Sep 17 00:00:00 2001 From: solidsnakedev Date: Thu, 19 Dec 2024 10:41:03 -0700 Subject: [PATCH] fix: hls using nix flake; hover diagnosic --- modules/init.lua | 10 +++++++++- modules/nixvim.nix | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/init.lua b/modules/init.lua index 49144dd..b99ab2d 100644 --- a/modules/init.lua +++ b/modules/init.lua @@ -35,7 +35,7 @@ vim.opt.cursorline = true -- Highlight cursor line vim.opt.shiftwidth = 2 -- Set shift width to 2 spaces vim.opt.tabstop = 2 -- Set tab width to 2 columns vim.opt.expandtab = true -- Use spaces instead of tabs -vim.opt.scrolloff = 10 -- Do not scroll below/above N lines +vim.opt.scrolloff = 20 -- Do not scroll below/above N lines vim.opt.wrap = false -- Do not wrap lines vim.opt.incsearch = true -- Highlight matches as you type vim.opt.ignorecase = true -- Ignore case in searches @@ -65,6 +65,8 @@ map('n', '', 'yyddkP') map('n', '', 'yyddp') nmap('h', ':nohl') -- Toggle highlight search +-- Show all diagnostics on current line in floating window +nmap("d", ":lua vim.diagnostic.open_float()") nmap("n", ":Neotree toggle reveal") nmap("gg", ":LazyGit") nmap("ff", ":Telescope find_files") @@ -129,3 +131,9 @@ require('dashboard').setup({ }, }, }) + +require('lspconfig').hls.setup { + cmd = (vim.fn.executable('haskell-language-server-wrapper') == 1 and { 'haskell-language-server-wrapper', '--lsp' }) + or (vim.fn.executable('haskell-language-server') == 1 and { 'haskell-language-server', '--lsp' }) + or nil, +} diff --git a/modules/nixvim.nix b/modules/nixvim.nix index a537a9d..eca357b 100644 --- a/modules/nixvim.nix +++ b/modules/nixvim.nix @@ -17,6 +17,10 @@ in # Create aliases for Vi and Vim commands viAlias = true; vimAlias = true; + diagnostics = { + virtual_text = false; + float = { border = "rounded"; }; + }; # Color Scheme # Use Catppuccin color scheme @@ -125,6 +129,7 @@ in hls = { enable = true; installGhc = false; + package = null; }; # TypeScript language server ts_ls.enable = true;