diff --git a/nix/flake.lock b/nix/flake.lock index e2af8f6..5ac127e 100644 --- a/nix/flake.lock +++ b/nix/flake.lock @@ -96,11 +96,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -118,11 +118,11 @@ ] }, "locked": { - "lastModified": 1703887061, - "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", "type": "github" }, "original": { @@ -138,11 +138,11 @@ ] }, "locked": { - "lastModified": 1710714957, - "narHash": "sha256-eZCxuF58YWgaJMMRrn8oRkwRhxooe5kBS/s2wRVr9PA=", + "lastModified": 1710820906, + "narHash": "sha256-2bNMraoRB4pdw/HtxgYTFeMhEekBZeQ53/a8xkqpbZc=", "owner": "nix-community", "repo": "home-manager", - "rev": "7b3fca5adcf6c709874a8f2e0c364fe9c58db989", + "rev": "022464438a85450abb23d93b91aa82e0addd71fb", "type": "github" }, "original": { @@ -159,11 +159,11 @@ ] }, "locked": { - "lastModified": 1710714957, - "narHash": "sha256-eZCxuF58YWgaJMMRrn8oRkwRhxooe5kBS/s2wRVr9PA=", + "lastModified": 1710820906, + "narHash": "sha256-2bNMraoRB4pdw/HtxgYTFeMhEekBZeQ53/a8xkqpbZc=", "owner": "nix-community", "repo": "home-manager", - "rev": "7b3fca5adcf6c709874a8f2e0c364fe9c58db989", + "rev": "022464438a85450abb23d93b91aa82e0addd71fb", "type": "github" }, "original": { @@ -195,11 +195,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1710631334, - "narHash": "sha256-rL5LSYd85kplL5othxK5lmAtjyMOBg390sGBTb3LRMM=", + "lastModified": 1710806803, + "narHash": "sha256-qrxvLS888pNJFwJdK+hf1wpRCSQcqA6W5+Ox202NDa0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c75037bbf9093a2acb617804ee46320d6d1fea5a", + "rev": "b06025f1533a1e07b6db3e75151caa155d1c7eb3", "type": "github" }, "original": { @@ -222,11 +222,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1710856562, - "narHash": "sha256-JM24d2f60/9q7D7nzyhGm0gcH+HQsrY8Q0rGOFcJzeQ=", + "lastModified": 1710936779, + "narHash": "sha256-ecYnUzSWqRae10pp7J6ZE2BznTPJ9f8sLiIoDBQtRBw=", "owner": "nix-community", "repo": "nixvim", - "rev": "0a5e0c68b829f9fec135f479e3ec34332660f93d", + "rev": "4f6e90212c7ec56d7c03611fb86befa313e7f61f", "type": "github" }, "original": { @@ -250,11 +250,11 @@ ] }, "locked": { - "lastModified": 1708018599, - "narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=", + "lastModified": 1710843117, + "narHash": "sha256-b6iKQeHegzpc697rxTPA3bpwGN3m50eLCgdQOmceFuE=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431", + "rev": "e8dc1b4fe80c6fcededde7700e6a23bcdf7f3347", "type": "github" }, "original": { diff --git a/nix/nvim/cmp/cmp.nix b/nix/nvim/cmp/cmp.nix index 4809f71..0de1892 100644 --- a/nix/nvim/cmp/cmp.nix +++ b/nix/nvim/cmp/cmp.nix @@ -5,7 +5,7 @@ }: { programs.nixvim = { plugins.luasnip.enable = true; - plugins.friendly-snippets.enable=true; + plugins.friendly-snippets.enable = true; plugins.cmp = { enable = true; autoEnableSources = true; diff --git a/nix/nvim/gitsigns.nix b/nix/nvim/gitsigns.nix index 9a0ff0f..3f24cd6 100644 --- a/nix/nvim/gitsigns.nix +++ b/nix/nvim/gitsigns.nix @@ -7,6 +7,9 @@ plugins.gitsigns = { enable = true; }; + plugins.which-key.registrations = { + "g" = "+git"; + }; keymaps = [ { action = ":Gitsigns toggle_current_line_blame"; diff --git a/nix/nvim/keybinds.nix b/nix/nvim/keybinds.nix index c2c753d..f10067e 100644 --- a/nix/nvim/keybinds.nix +++ b/nix/nvim/keybinds.nix @@ -7,7 +7,9 @@ globals = { mapleader = ";"; }; - + plugins.which-key.registrations = { + "c" = "+check"; + }; keymaps = [ { action = ":setlocal spell!"; diff --git a/nix/nvim/lsp/lsp.nix b/nix/nvim/lsp/lsp.nix index ba8d1f6..a8bde56 100644 --- a/nix/nvim/lsp/lsp.nix +++ b/nix/nvim/lsp/lsp.nix @@ -4,8 +4,191 @@ ... }: { programs.nixvim = { + plugins.lsp={ + enable=true; + servers={ + bashls.enable=true; + clangd.enable=true; + lua-ls.enable=true; + nil_ls.enable=true; + nushell.enable=true; + pyright.enable=true; + ruff-lsp.enable=true; + rust-analyzer={ + enable=true; + installCargo=true; + installRustc=true; + }; + texlab.enable=true; + typst-lsp.enable=true; + taplo.enable=true; + yamlls.enable=true; + marksman.enable=true; + jsonls.enable=true; + hls.enable=true; + }; + }; + plugins.cmp.settings.sources=[ + {name="nvim_lsp";} + ]; + plugins.which-key.registrations = { + "l" = "+lsp"; + }; + keymaps = [ + { + action = "vim.lsp.buf.declaration"; + key = "lc"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "declaration"; + }; + } + { + action = "vim.lsp.buf.definition"; + key = "ld"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "definition"; + }; + } + { + action = "vim.lsp.buf.hover"; + key = "lh"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "hover"; + }; + } + { + action = "vim.lsp.buf.implementation"; + key = "li"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "implementation"; + }; + } + { + action = "vim.lsp.buf.signature_help"; + key = "ls"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "signature_help"; + }; + } + { + action = "vim.lsp.buf.add_workspace_folder"; + key = "lwa"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "add folder"; + }; + } + { + action = "vim.lsp.buf.remove_workspace_folder"; + key = "lwr"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "remove folder"; + }; + } + { + action = "vim.lsp.buf.list_workspace_folders"; + key = "lw"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "workspace"; + }; + } + { + action = "vim.lsp.buf.rename"; + key = "lr"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "rename"; + }; + } + { + action = "vim.lsp.buf.code_action"; + key = "la"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "code action"; + }; + } + { + action = "vim.lsp.buf.references"; + key = "le"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "list references"; + }; + } + { + action = "function() vim.lsp.buf.format{async=true} end"; + key = "lm"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "format buffer"; + }; + } + { + action = "vim.diagnostic.open_float"; + key = "lo"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "open float"; + }; + } + { + action = "vim.diagnostic.goto_next"; + key = "]d"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "next diagnostic"; + }; + } + { + action = "vim.diagnostic.goto_prev"; + key = "[d"; + lua = true; + mode = "n"; + options = { + silent = true; + desc = "prev diagnostic"; + }; + } + ]; }; imports = [ - # ./outline.nix + ./outline.nix + ./rust-tools.nix ]; } diff --git a/nix/nvim/lsp/rust-tools.nix b/nix/nvim/lsp/rust-tools.nix new file mode 100644 index 0000000..a31a819 --- /dev/null +++ b/nix/nvim/lsp/rust-tools.nix @@ -0,0 +1,11 @@ +{ + configs, + pkgs, + ... +}: { + programs.nixvim = { + plugins.rust-tools = { + enable = true; + }; + }; +}