dotfiles/hm/vim/lsp.nix

56 lines
1.8 KiB
Nix

{ pkgs, lib, config, ... }:
{
config = {
programs.nixvim = {
extraConfigLua = ''
require'lsp_signature'.on_attach({
hint_enable = false,
})
'';
extraPlugins = with pkgs.vimPlugins; [
# Language server
lsp_signature-nvim # Show argument definition when typing a function
];
keymaps = [
];
plugins = {
# Language Server
lsp = {
enable = true;
keymaps = {
silent = true;
diagnostic = {
"<Space>e" = "open_float";
"[e" = "goto_prev";
"]e" = "goto_next";
};
lspBuf = {
# TODO Include the Telescope ones in this file
"gD" = "declaration";
"K" = "hover";
"gi" = "implementation";
"<C-S-k>" = "signature_help";
"<space>wa" = "add_workspace_folder";
"<space>wr" = "remove_workspace_folder";
# "<space>wl" = "list_workspace_folder";
# TODO Full thing was function() print(vim.inspect(vim.lsp.buf.list_workspace_folder())) end but not sure I'm ever really using this
# Also makes nvim crash like this, so uncommented
"<space>D" = "type_definition";
"<space>rn" = "rename";
"<space>ca" = "code_action";
"<space>f" = "format";
# TODO Full thing was function() vim.lsp.buf.format { async = true } end, so async while this isn't
# Maybe replace this with lsp-format?
};
};
};
nvim-lightbulb = {
# Shows a lightbulb whenever a codeAction is available under the cursor
enable = true;
autocmd.enabled = true;
};
};
};
};
}