Update rust-tools init

This commit is contained in:
Thomas Gideon 2022-08-14 09:46:16 -04:00
parent 94d44b3134
commit d2af6e0d9e
1 changed files with 12 additions and 19 deletions

31
lsp.vim
View File

@ -13,26 +13,19 @@ set shortmess+=c
" rust-tools will configure and enable certain LSP features for us.
" See https://github.com/simrat39/rust-tools.nvim#configuration
lua <<EOF
local nvim_lsp = require'lspconfig'
local opts = {
tools = { -- rust-tools options
autoSetHints = true,
hover_with_actions = true,
inlay_hints = {
show_parameter_hints = false,
parameter_hints_prefix = "",
other_hints_prefix = "",
},
local rt = require('rust-tools')
rt.setup({
server = {
server = {
on_attach = function(_, buffnr)
-- Hover actions
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr})
-- Code action groups
vim.keymap.set("n", "<Leader>a>", rt.code_action_group.code_action_group, { buffer = bufnr})
end
},
-- all the opts to send to nvim-lspconfig
-- these override the defaults set by rust-tools.nvim
-- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
server = {}, -- rust-analyer options
}
require('rust-tools').setup(opts)
}, -- rust-analyer options
})
EOF
" Setup Completion