{ 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 = [ # barbar { key = ""; action = "BufferPrevious"; options = { silent = true; }; } { key = ""; action = "BufferNext"; options = { silent = true; }; } # TODO https://www.reddit.com/r/neovim/comments/mbj8m5/how_to_setup_ctrlshiftkey_mappings_in_neovim_and/ { key = ""; action = "BufferMovePrevious"; options = { silent = true; }; } { key = ""; action = "BufferMoveNext"; options = { silent = true; }; } # TODO gotos don't work { key = ""; action = "BufferGoto 1"; options = { silent = true; }; } { key = ""; action = "BufferGoto 2"; options = { silent = true; }; } { key = ""; action = "BufferGoto 3"; options = { silent = true; }; } { key = ""; action = "BufferGoto 4"; options = { silent = true; }; } { key = ""; action = "BufferGoto 5"; options = { silent = true; }; } { key = ""; action = "BufferGoto 6"; options = { silent = true; }; } { key = ""; action = "BufferGoto 7"; options = { silent = true; }; } { key = ""; action = "BufferGoto 8"; options = { silent = true; }; } { key = ""; action = "BufferGoto 9"; options = { silent = true; }; } { key = ""; action = "BufferLast"; options = { silent = true; }; } { key = "gb"; action = "BufferPick"; options = { silent = true; }; } # TODO Other useful options? ]; plugins = { # Language Server lsp = { enable = true; keymaps = { silent = true; diagnostic = { "e" = "open_float"; "[e" = "goto_prev"; "]e" = "goto_next"; }; lspBuf = { "gD" = "declaration"; "K" = "hover"; "gi" = "implementation"; "" = "signature_help"; "wa" = "add_workspace_folder"; "wr" = "remove_workspace_folder"; # "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 "D" = "type_definition"; "rn" = "rename"; "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; }; }; }; }; }