Skip to content

Commit

Permalink
fix(neovim): problem with LSP in Haskell mode
Browse files Browse the repository at this point in the history
Added nvim-cmp support, restore treesitter and many changes to fixed up
Haskell in neovim
  • Loading branch information
Wittano committed Jul 22, 2024
1 parent d9f6185 commit 3d056bc
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions modules/dev/neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ in
enableMan = true;
viAlias = true;

extraPlugins = with pkgs.vimPlugins; [ vim-wakatime vimsence nvim-comment ];
extraPlugins = with pkgs.vimPlugins; [ vim-wakatime vimsence nvim-comment nvim-treesitter-parsers.haskell ];

extraConfigLua = /*lua*/
''
Expand Down Expand Up @@ -133,19 +133,23 @@ in
enable = true; # Nix
settings.formatting.command = [ "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt" ];
};
hls.enable = config.modules.desktop.xmonad.enable
|| ((lists.findFirst (x: x == "haskell") null config.modules.dev.lang.ides) != null);
hls = {
enable = true;
package = pkgs.haskell-language-server;
};
dockerls.enable = true;
ansiblels.enable = true;
lua-ls.enable = true;
cmake.enable = true;
};
};

treesitter.enable = true;

luasnip.enable = true;
cmp-nvim-lua.enable = true;
cmp-nvim-lsp.enable = true;
cmp-path.enable = true;
cmp-snippy.enable = true;
cmp-buffer.enable = true;
cmp-spell.enable = true;
cmp-vim-lsp.enable = true;
Expand All @@ -155,13 +159,16 @@ in
sources = [
{ name = "nvim_lsp"; }
{ name = "path"; }
{ name = "snippy"; }
{ name = "spell"; }
{ name = "buffer"; }
{ name = "vim_lsp"; }
{ name = "nvim_lua"; }
];
snippet.expand = "luasnip";
snippet.expand = ''
function(args)
require('luasnip').lsp_expand(args.body)
end
'';
mapping.__raw = ''
cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
Expand Down

0 comments on commit 3d056bc

Please sign in to comment.