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)