From 3b2460f97a8ad990dc68c6175538319f3a5ee6eb Mon Sep 17 00:00:00 2001 From: blake Date: Mon, 13 Oct 2025 15:54:29 -0500 Subject: [PATCH] add formatter --- users/blake/dots/neovim/default.nix | 36 +++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/users/blake/dots/neovim/default.nix b/users/blake/dots/neovim/default.nix index 84cb28d..c475ceb 100644 --- a/users/blake/dots/neovim/default.nix +++ b/users/blake/dots/neovim/default.nix @@ -16,7 +16,18 @@ vimAlias = true; - lsp.enable = true; + lsp = { + enable = true; + servers.nix = { + enable = true; + format = { + enable = true; + command = "alejandra"; + args = []; + }; + }; + }; + statusline.lualine.enable = true; telescope.enable = true; autocomplete.nvim-cmp.enable = true; @@ -31,9 +42,26 @@ { key = ""; mode = [ "n" "v" ]; action = "g"; desc = "Visual Line Up"; } { key = ""; mode = [ "n" "v" ]; action = "g"; desc = "Visual Line Down"; } - { key = "gd"; mode = [ "n" ]; action = "lua vim.lsp.buf.definition()"; desc = "Go to definition"; } - { key = "K"; mode = [ "n" ]; action = "lua vim.lsp.buf.hover()"; desc = "Hover info"; } - { key = "f"; mode = [ "n" ]; action = "lua vim.lsp.buf.format({ async = true })"; desc = "Format buffer"; } + # lsp + #{ key = "gd"; mode = [ "n" ]; action = "lua vim.lsp.buf.definition()"; desc = "Go to definition"; } + #{ key = "K"; mode = [ "n" ]; action = "lua vim.lsp.buf.hover()"; desc = "Hover info"; } + #{ key = "f"; mode = [ "n" ]; action = "lua vim.lsp.buf.format({ async = true })"; desc = "Format buffer"; } + + { key = "gd"; mode = [ "n" ]; silent = true; action = "lua vim.lsp.buf.definition()"; desc = "Go to definition"; } + # Hover info + { key = "K"; mode = [ "n" ]; silent = true; action = "lua vim.lsp.buf.hover()"; desc = "Hover info"; } + # Format buffer (Alejandra for Nix) + { key = "F"; mode = [ "n" ]; silent = true; action = "lua vim.lsp.buf.format({ async = true })"; desc = "Format buffer"; } + # Code actions / quickfix + { key = "a"; mode = [ "n" ]; silent = true; action = "lua vim.lsp.buf.code_action()"; desc = "Code action"; } + # Rename symbol + { key = "r"; mode = [ "n" ]; silent = true; action = "lua vim.lsp.buf.rename()"; desc = "Rename symbol"; } + # Diagnostics + { key = "e"; mode = [ "n" ]; silent = true; action = "lua vim.diagnostic.open_float()"; desc = "Show diagnostic"; } + { key = "[d"; mode = [ "n" ]; silent = true; action = "lua vim.diagnostic.goto_prev()"; desc = "Previous diagnostic"; } + { key = "]d"; mode = [ "n" ]; silent = true; action = "lua vim.diagnostic.goto_next()"; desc = "Next diagnostic"; } + + ];