Update rust-tools init
This commit is contained in:
parent
94d44b3134
commit
d2af6e0d9e
1 changed files with 12 additions and 19 deletions
31
lsp.vim
31
lsp.vim
|
@ -13,26 +13,19 @@ set shortmess+=c
|
||||||
" rust-tools will configure and enable certain LSP features for us.
|
" rust-tools will configure and enable certain LSP features for us.
|
||||||
" See https://github.com/simrat39/rust-tools.nvim#configuration
|
" See https://github.com/simrat39/rust-tools.nvim#configuration
|
||||||
lua <<EOF
|
lua <<EOF
|
||||||
local nvim_lsp = require'lspconfig'
|
local rt = require('rust-tools')
|
||||||
|
rt.setup({
|
||||||
local opts = {
|
server = {
|
||||||
tools = { -- rust-tools options
|
server = {
|
||||||
autoSetHints = true,
|
on_attach = function(_, buffnr)
|
||||||
hover_with_actions = true,
|
-- Hover actions
|
||||||
inlay_hints = {
|
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr})
|
||||||
show_parameter_hints = false,
|
-- Code action groups
|
||||||
parameter_hints_prefix = "",
|
vim.keymap.set("n", "<Leader>a>", rt.code_action_group.code_action_group, { buffer = bufnr})
|
||||||
other_hints_prefix = "",
|
end
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
}, -- rust-analyer options
|
||||||
-- 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)
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
" Setup Completion
|
" Setup Completion
|
||||||
|
|
Loading…
Reference in a new issue