diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-10-05 22:34:46 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-10-05 22:34:46 +0200 |
commit | b38174f26f3e8c43085308bd43ae5617159ff998 (patch) | |
tree | 2971e9bee492d2bd0e583d93318482205967c02b /.config/nvim/lua/lsp/config.lua | |
parent | 77cdf208765ad351e48724ed5ad57e55703eca61 (diff) |
Lsp make buffer mappings configurable
Diffstat (limited to '.config/nvim/lua/lsp/config.lua')
-rw-r--r-- | .config/nvim/lua/lsp/config.lua | 19 |
1 files changed, 18 insertions, 1 deletions
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"] = { "<cmd>lua vim.lsp.buf.hover()<CR>", "Show hover" }, + ["gd"] = { "<cmd>lua vim.lsp.buf.definition()<CR>", "Goto Definition" }, + ["gD"] = { "<cmd>lua vim.lsp.buf.declaration()<CR>", "Goto declaration" }, + ["gr"] = { "<cmd>lua vim.lsp.buf.references()<CR>", "Goto references" }, + ["gI"] = { "<cmd>lua vim.lsp.buf.implementation()<CR>", "Goto Implementation" }, + ["gs"] = { "<cmd>lua vim.lsp.buf.signature_help()<CR>", "show signature help" }, + ["gp"] = { "<cmd>lua require'lsp.peek'.Peek('definition')<CR>", "Peek definition" }, + ["gl"] = { + "<cmd>lua require'lsp.handlers'.show_line_diagnostics()<CR>", + "Show line diagnostics", + }, + }, + insert_mode = {}, + visual_mode = {}, + }, null_ls = { setup = {}, }, |