rust-tools

This commit is contained in:
Ray Elliott 2022-07-24 16:12:06 +01:00
parent a45cace9f2
commit b765de7e3f
3 changed files with 34 additions and 12 deletions

View File

@ -6,6 +6,10 @@ if empty(glob('~/.config/nvim/autoload/plug.vim'))"
endif endif
call plug#begin('~/.config/nvim/bundle') call plug#begin('~/.config/nvim/bundle')
" evaluating
" https://github.com/simrat39/rust-tools.nvim
Plug 'simrat39/rust-tools.nvim'
" colorscheme (temporary) " colorscheme (temporary)
Plug 'https://github.com/marko-cerovac/material.nvim', { 'branch': 'main' } Plug 'https://github.com/marko-cerovac/material.nvim', { 'branch': 'main' }
let g:material_style = 'lighter' let g:material_style = 'lighter'

View File

@ -30,9 +30,10 @@ local servers = {
-- no formatting support -- no formatting support
'vimls', -- vue 'vimls', -- vue
-- use vetur -- use vetur
'yamlls', -- no formatting support 'yamlls' -- no formatting support
-- is now automatically started/configured by rust-tools
-- sudo pacman -Syu rust-analyzer -- sudo pacman -Syu rust-analyzer
'rust_analyzer' -- 'rust_analyzer'
} }
-- Use an on_attach function to only map the following keys -- Use an on_attach function to only map the following keys
@ -158,6 +159,25 @@ require'lspconfig'.taplo.setup {
cmd = {"taplo", "lsp", "stdio"} cmd = {"taplo", "lsp", "stdio"}
} }
-- rust-tools
-- evaluating
require('rust-tools').setup({
server = {
on_attach = on_attach,
capabilities = capabilities,
flags = {debounce_text_changes = 150},
settings = {["rust-analyzer"] = {checkOnSave = {command = "clippy"}}}
}
})
-- set inlay hints
require('rust-tools.inlay_hints').set_inlay_hints()
-- disable inlay hints
require('rust-tools.inlay_hints').disable_inlay_hints()
-- toggle inlay hints
require('rust-tools.inlay_hints').toggle_inlay_hints()
------
-- null-ls -- null-ls
local null_ls = require("null-ls") local null_ls = require("null-ls")

View File

@ -6,10 +6,8 @@ require("cmp").setup({
map_complete = false, -- it will auto insert `(` after select function or method item map_complete = false, -- it will auto insert `(` after select function or method item
auto_select = true -- automatically select the first item auto_select = true -- automatically select the first item
}) })
------
-- nvim-ts-autotag -- nvim-ts-autotag
require'nvim-treesitter.configs'.setup { require'nvim-treesitter.configs'.setup {autotag = {enable = true}}
autotag = { ------
enable = true,
}
}