vim: Fix lsp todos

This commit is contained in:
Geoffrey Frogeye 2024-01-20 19:24:04 +01:00
parent 97a3e5f6e4
commit a57c6527ce
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
2 changed files with 29 additions and 12 deletions

View file

@ -50,10 +50,6 @@
gH = "command_history"; gH = "command_history";
gS = "search_history"; gS = "search_history";
gC = "commands"; gC = "commands";
gr = "lsp_references";
ge = "diagnostics";
gd = "lsp_definitions";
gs = "lsp_document_symbols";
}; };
defaults = { defaults = {
vimgrep_arguments = [ vimgrep_arguments = [

View file

@ -12,6 +12,28 @@
lsp_signature-nvim # Show argument definition when typing a function lsp_signature-nvim # Show argument definition when typing a function
]; ];
keymaps = [ keymaps = [
{
mode = "n";
key = "<space>wl";
lua = true;
action = ''
function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end
'';
options.silent = true;
}
{
mode = "n";
key = "<space>f";
lua = true;
action = ''
function()
vim.lsp.buf.format { async = true }
end
'';
options.silent = true;
}
]; ];
plugins = { plugins = {
# Language Server # Language Server
@ -25,25 +47,24 @@
"]e" = "goto_next"; "]e" = "goto_next";
}; };
lspBuf = { lspBuf = {
# TODO Include the Telescope ones in this file
"gD" = "declaration"; "gD" = "declaration";
"K" = "hover"; "K" = "hover";
"gi" = "implementation"; "gi" = "implementation";
"<C-S-k>" = "signature_help"; "<C-S-k>" = "signature_help";
"<space>wa" = "add_workspace_folder"; "<space>wa" = "add_workspace_folder";
"<space>wr" = "remove_workspace_folder"; "<space>wr" = "remove_workspace_folder";
# "<space>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
"<space>D" = "type_definition"; "<space>D" = "type_definition";
"<space>rn" = "rename"; "<space>rn" = "rename";
"<space>ca" = "code_action"; "<space>ca" = "code_action"; # Reference has a binding for visual mode, but it doesn't work
"<space>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?
}; };
}; };
}; };
telescope.keymaps = {
gr = "lsp_references";
ge = "diagnostics";
gd = "lsp_definitions";
gs = "lsp_document_symbols";
};
nvim-lightbulb = { nvim-lightbulb = {
# Shows a lightbulb whenever a codeAction is available under the cursor # Shows a lightbulb whenever a codeAction is available under the cursor
enable = true; enable = true;