From f9e4138ce30371c6fec5d084afaf6a51a5966769 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Wed, 6 Apr 2022 10:25:39 +0200 Subject: [PATCH] [nvim] Add LSP keybindings for rename, references, and code_action. --- .config/nvim/init.vim | 3 +++ .vimrc | 1 + 2 files changed, 4 insertions(+) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 8e1383f..0a77512 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -43,6 +43,9 @@ local on_attach = function(client, bufnr) opts = { noremap=true, silent=true } vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', 'lua vim.lsp.buf.definition()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'lrn', 'lua vim.lsp.buf.rename()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'lrr', 'lua vim.lsp.buf.references()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'lca', 'lua vim.lsp.buf.code_action()', opts) end -- Julia LSP (LanguageServer.jl) diff --git a/.vimrc b/.vimrc index 6e8c6cf..19b6617 100644 --- a/.vimrc +++ b/.vimrc @@ -54,6 +54,7 @@ call plug#end() "Misc keymappings and configurations :imap jk +:let mapleader = " " :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab smarttab autoindent "Nicer tab actions "Move aroung splits without the C-W prefix :nnoremap