From 69a1eede6b7cea721278de6ddbb772a024a8c483 Mon Sep 17 00:00:00 2001 From: blake Date: Thu, 9 Oct 2025 22:32:26 -0500 Subject: [PATCH] 191 current 2025-10-09 22:11:00 25.05.20251006.20c4598 6.12.50 * --- flake.nix | 2 +- hosts/snowbelle/configuration.nix | 5 ++- users/blake/dotfiles/nvim/lazy-lock.json | 6 ++- .../blake/dotfiles/nvim/lua/base/keymaps.lua | 41 +++++++++++++++++++ 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index c3ffe1a..65dce48 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ # flake for blakes nixos config # define new devices in outputs -# generation: 190 current 2025-10-09 22:00:15 25.05.20251006.20c4598 6.12.50 * +# generation: 191 current 2025-10-09 22:11:00 25.05.20251006.20c4598 6.12.50 * { description = "blakes nix config"; inputs = { diff --git a/hosts/snowbelle/configuration.nix b/hosts/snowbelle/configuration.nix index 0950ece..a305ec8 100644 --- a/hosts/snowbelle/configuration.nix +++ b/hosts/snowbelle/configuration.nix @@ -106,8 +106,11 @@ in curl fzf fd - nil + nixd nixfmt + rust + lua-language-server + pyright tree vim lf diff --git a/users/blake/dotfiles/nvim/lazy-lock.json b/users/blake/dotfiles/nvim/lazy-lock.json index f986153..56017af 100644 --- a/users/blake/dotfiles/nvim/lazy-lock.json +++ b/users/blake/dotfiles/nvim/lazy-lock.json @@ -4,7 +4,11 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" }, + "lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "6bdb14f230de0904229ec367b410fb817e59b072" }, + "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, + "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, "nightfox.nvim": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, "nvim-lspconfig": { "branch": "master", "commit": "cc2f5f2fa28d240574808e78847978ed6ef20d2a" }, diff --git a/users/blake/dotfiles/nvim/lua/base/keymaps.lua b/users/blake/dotfiles/nvim/lua/base/keymaps.lua index e69de29..850ee0d 100644 --- a/users/blake/dotfiles/nvim/lua/base/keymaps.lua +++ b/users/blake/dotfiles/nvim/lua/base/keymaps.lua @@ -0,0 +1,41 @@ +-- LSP Keymaps (applies when any LSP attaches) +vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspKeymaps", { clear = true }), + callback = function(event) + local opts = { buffer = event.buf, silent = true, noremap = true } + + -- 🧭 Navigation + vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) + vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) + vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts) + vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) + + -- 🧠 Info + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + vim.keymap.set("n", "", vim.lsp.buf.signature_help, opts) + + -- 🛠️ Actions + vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts) + + -- 🧹 Formatting + vim.keymap.set("n", "f", function() + vim.lsp.buf.format({ async = false }) + end, vim.tbl_extend("force", opts, { desc = "Format buffer with LSP" })) + + -- 💡 Diagnostics + vim.keymap.set("n", "d", vim.diagnostic.open_float, opts) + vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) + vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) + vim.keymap.set("n", "q", vim.diagnostic.setloclist, opts) + + -- 🧩 Inlay hints (toggle) + if vim.lsp.inlay_hint then + vim.keymap.set("n", "h", function() + local enabled = vim.lsp.inlay_hint.is_enabled(event.buf) + vim.lsp.inlay_hint.enable(not enabled, { bufnr = event.buf }) + end, vim.tbl_extend("force", opts, { desc = "Toggle inlay hints" })) + end + end, +}) +