From 86befa66af2b35eae9ecb51bf789f6122034a758 Mon Sep 17 00:00:00 2001 From: Erin Nova Date: Mon, 28 Mar 2022 20:30:17 -0400 Subject: [PATCH] Fix some rust-lsp neovim keybinds --- .vimrc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.vimrc b/.vimrc index b00870d..2d9bd69 100644 --- a/.vimrc +++ b/.vimrc @@ -305,3 +305,19 @@ nnoremap gr lua vim.lsp.buf.references() nnoremap g0 lua vim.lsp.buf.document_symbol() nnoremap gW lua vim.lsp.buf.workspace_symbol() nnoremap gd lua vim.lsp.buf.definition() +nnoremap ga lua vim.lsp.buf.code_action() + +" Set updatetime for CursorHold +" 300ms of no cursor movement to trigger CursorHold +set updatetime=300 +" Show diagnostic popup on cursor hold +autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false }) + +" Goto previous/next diagnostic warning/error +nnoremap g[ lua vim.diagnostic.goto_prev() +nnoremap g] lua vim.diagnostic.goto_next() +" have a fixed column for the diagnostics to appear in +" this removes the jitter when warnings/errors flow in +set signcolumn=yes +" Auto-format *.rs (rust) files prior to saving them +autocmd BufWritePre *.rs lua vim.lsp.buf.formatting_sync(nil, 1000)