diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 81e28d1..b08167f 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -150,7 +150,7 @@ font: style: Oblique # Point size - size: 16.0 + size: 19.0 # Offset is the extra space around each character. `offset.y` can be thought # of as modifying the line spacing, and `offset.x` as modifying the letter diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 20ab0cb..15c5a4b 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -7,8 +7,21 @@ local nvim_lsp = require'lspconfig' local on_attach = function(client) end +local rust_capabilities = vim.lsp.protocol.make_client_capabilities() +rust_capabilities.textDocument.completion.completionItem.snippetSupport = true +rust_capabilities.textDocument.completion.completionItem.resolveSupport = { + properties = { + 'documentation', + 'detail', + 'additionalTextEdits', + } +} + -- Enable rust_analyzer -nvim_lsp.rust_analyzer.setup({ on_attach=on_attach }) +nvim_lsp.rust_analyzer.setup({ + on_attach=on_attach, + capabilities=rust_capabilities, +}) nvim_lsp.gopls.setup({ on_attach=on_attach }) nvim_lsp.pyright.setup({ on_attach=on_attach }) nvim_lsp.clangd.setup({ on_attach=on_attach }) @@ -41,6 +54,9 @@ nvim_lsp.efm.setup { }, python = { { formatCommand = 'black --quiet -', formatStdin = true } + }, + rust = { + { formatCommand = 'rustfmt', formatStdin = true } } } } @@ -169,7 +185,7 @@ require('lspkind').init({ }) require('trouble').setup { - mode = "lsp_document_diagnostics", + mode = "document_diagnostics", auto_close = true, action_keys = { -- key mappings for actions in the trouble list -- map to {} to remove a mapping, for example: diff --git a/.vimrc b/.vimrc index f353c23..47c70c4 100644 --- a/.vimrc +++ b/.vimrc @@ -268,7 +268,8 @@ nnoremap gW lua vim.lsp.buf.workspace_symbol() "nnoremap ga lua vim.lsp.buf.code_action() nnoremap ga lua require('telescope.builtin').lsp_code_actions({initial_mode = "normal"}) vnoremap ga :lua require('telescope.builtin').lsp_range_code_actions({initial_mode = "normal"}) -nnoremap ge lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false}) +"nnoremap ge lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false}) +nnoremap ge lua vim.diagnostic.open_float({focusable = false}) nnoremap xx TroubleToggle @@ -276,7 +277,7 @@ nnoremap xx TroubleToggle " 300ms of no cursor movement to trigger CursorHold set updatetime=500 " Show diagnostic popup on cursor hold -autocmd CursorHold * lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false}) +autocmd CursorHold * lua vim.diagnostic.open_float({focusable = false}) " Autoformat on save autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_sync(nil, 1000)