From b38174f26f3e8c43085308bd43ae5617159ff998 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Oct 2021 22:34:46 +0200 Subject: Lsp make buffer mappings configurable --- .config/nvim/lua/lsp/config.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to '.config/nvim/lua/lsp/config.lua') diff --git a/.config/nvim/lua/lsp/config.lua b/.config/nvim/lua/lsp/config.lua index b748b3c..32185b5 100644 --- a/.config/nvim/lua/lsp/config.lua +++ b/.config/nvim/lua/lsp/config.lua @@ -1,5 +1,5 @@ return { - templates_dir = join_paths(get_data_dir(), "site", "after", "ftplugin"), + templates_dir = join_paths(get_runtime_dir(), "site", "after", "ftplugin"), diagnostics = { signs = { active = true, @@ -21,6 +21,23 @@ return { on_attach_callback = nil, on_init_callback = nil, automatic_servers_installation = true, + buffer_mappings = { + normal_mode = { + ["K"] = { "lua vim.lsp.buf.hover()", "Show hover" }, + ["gd"] = { "lua vim.lsp.buf.definition()", "Goto Definition" }, + ["gD"] = { "lua vim.lsp.buf.declaration()", "Goto declaration" }, + ["gr"] = { "lua vim.lsp.buf.references()", "Goto references" }, + ["gI"] = { "lua vim.lsp.buf.implementation()", "Goto Implementation" }, + ["gs"] = { "lua vim.lsp.buf.signature_help()", "show signature help" }, + ["gp"] = { "lua require'lsp.peek'.Peek('definition')", "Peek definition" }, + ["gl"] = { + "lua require'lsp.handlers'.show_line_diagnostics()", + "Show line diagnostics", + }, + }, + insert_mode = {}, + visual_mode = {}, + }, null_ls = { setup = {}, }, -- cgit v1.2.3-70-g09d2