diff --git a/nvim.configlink/init.lua b/nvim.configlink/init.lua index 55ee97c..50bb04a 100644 --- a/nvim.configlink/init.lua +++ b/nvim.configlink/init.lua @@ -138,7 +138,13 @@ require("packer").startup(function(use) require("lspconfig").rust_analyzer.setup({ capabilities = capabilities }) require("lspconfig").tflint.setup({ capabilities = capabilities }) require("lspconfig").terraformls.setup({ capabilities = capabilities }) - require("lspconfig").pyright.setup({ capabilities = capabilities }) + require("lspconfig").pyright.setup({ + on_attach = function() + -- set keymaps (requires 0.7.0) + -- vim.keymap.set("n", "", "", {buffer=0}) + end, + capabilities = capabilities, + }) end, }) @@ -445,7 +451,12 @@ vim.o.mouse = "nv" --- Mouse interaction / scrolling -- Neovim features vim.o.inccommand = "split" --- Live preview search and replace -vim.o.completeopt = "menu,menuone,noselect" --- Required for nvim-cmp completion +--- Required for nvim-cmp completion +vim.opt.completeopt = { + "menu", + "menuone", + "noselect", +} -- Required until 0.6.0: do not source the default filetype.vim vim.g.did_load_filetypes = 1 @@ -658,11 +669,15 @@ key("n", "3", "lua require('harpoon.ui').nav_file(3)") -- LSP key("n", "gd", "lua vim.lsp.buf.definition()", { silent = true }) +key("n", "gT", "lua vim.lsp.buf.type_definition()", { silent = true }) key("n", "gi", "lua vim.lsp.buf.implementation()", { silent = true }) key("n", "gh", "lua vim.lsp.buf.hover()", { silent = true }) -key("n", "]e", "lua vim.lsp.diagnostic.goto_next()", { silent = true }) -key("n", "[e", "lua vim.lsp.diagnostic.goto_prev()", { silent = true }) +key("n", "gr", "Telescope lsp_references", { silent = true }) +key("n", "R", "lua vim.lsp.buf.rename()", { silent = true }) +key("n", "]e", "lua vim.diagnostic.goto_next()", { silent = true }) +key("n", "[e", "lua vim.diagnostic.goto_prev()", { silent = true }) key("n", "e", "lua vim.lsp.diagnostic.show_line_diagnostics()", { silent = true }) +key("n", "E", "lua vim.lsp.buf.code_action()", { silent = true }) -- File commands key("n", "q", ":quit")