diff --git a/home.nix b/home.nix index b4d058e..256c6c0 100755 --- a/home.nix +++ b/home.nix @@ -317,22 +317,26 @@ lsp-format.enable = true; lsp = { - inlayHints.enable = true; + enable = true; + inlayHints = true; + servers = { - html.enable = true; - lua_ls.enable = true; - nil_ls.enable = true; - ts_ls.enable = true; - marksman.enable = true; - pyright.enable = true; + html.enable = true; + lua_ls.enable = true; + nil_ls.enable = true; + ts_ls.enable = true; + marksman.enable = true; + pyright.enable = true; gopls.enable = true; - terraformls.enable = true; - ansiblels.enable = true; + terraformls.enable = true; jsonls.enable = true; - yamlls.enable = true; + yamlls.enable = true; + rust_analyzer = { enable = true; - config = { + installRustc = true; + installCargo = true; + settings = { cargo = { features = "all"; }; @@ -340,80 +344,68 @@ }; }; - keymaps = [ - { - key = "gd"; - lspBufAction = "definition"; - options.desc = "Goto Definition"; - options.silent = true; - mode = [ "n" ]; - } - { - key = "gr"; - lspBufAction = "references"; - options.desc = "Goto References"; - options.silent = true; - mode = [ "n" ]; - } - { - key = "gD"; - lspBufAction = "declaration"; - options.desc = "Goto Declaration"; - options.silent = true; - mode = [ "n" ]; - } - { - key = "gI"; - lspBufAction = "implementation"; - options.desc = "Goto Implementation"; - options.silent = true; - mode = [ "n" ]; - } - { - key = "gT"; - lspBufAction = "type_definition"; - options.desc = "Type Definition"; - options.silent = true; - mode = [ "n" ]; - } - { - key = "K"; - lspBufAction = "hover { border = 'single' }"; - options.desc = "Hover"; - options.silent = true; - mode = [ "n" ]; - } - { - key = "cw"; - action = "workspace_symbol"; - options.desc = "Workspace Symbol"; - mode = [ "n" ]; - } - { - key = "r"; - action = "rename"; - options.desc = "Rename variable"; - mode = [ "n" ]; - } - { - key = "cd"; - action = "open_float"; - options.desc = "Line Diagnostics"; - mode = [ "n" ]; - } - { - key = "]d"; - action = "goto_next"; - options.desc = "Next Diagnostic"; - mode = [ "n" ]; - } - { - key = "[d"; - action = "goto_prev"; - options.desc = "Previous Diagnostic"; - mode = [ "n" ]; - } - ]; + keymaps = { + silent = true; + + lspBuf = { + gd = { + action = "definition"; + desc = "Goto Definition"; + }; + + gr = { + action = "references"; + desc = "Goto References"; + }; + + gD = { + action = "declaration"; + desc = "Goto Declaration"; + }; + + gI = { + action = "implementation"; + desc = "Goto Implementation"; + }; + + gT = { + action = "type_definition"; + desc = "Type Definition"; + }; + + K = { + action = "hover"; + desc = "Hover"; + }; + + "cw" = { + action = "workspace_symbol"; + desc = "Workspace Symbol"; + }; + + "r" = { + action = "rename"; + desc = "Rename"; + }; + }; + + diagnostic = { + "cd" = { + action = "open_float"; + desc = "Line Diagnostics"; + }; + + "]d" = { + action = "goto_next"; + desc = "Next Diagnostic"; + }; + + "[d" = { + action = "goto_prev"; + desc = "Previous Diagnostic"; + }; + }; + }; }; neo-tree = {