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
call plug#begin('~/.config/nvim/bundle')
" evaluating
" https://github.com/simrat39/rust-tools.nvim
Plug 'simrat39/rust-tools.nvim'
" colorscheme (temporary)
Plug 'https://github.com/marko-cerovac/material.nvim', { 'branch': 'main' }
let g:material_style = 'lighter'

View File

@ -30,9 +30,10 @@ local servers = {
-- no formatting support
'vimls', -- vue
-- use vetur
'yamlls', -- no formatting support
'yamlls' -- no formatting support
-- is now automatically started/configured by rust-tools
-- sudo pacman -Syu rust-analyzer
'rust_analyzer'
-- 'rust_analyzer'
}
-- Use an on_attach function to only map the following keys
@ -158,6 +159,25 @@ require'lspconfig'.taplo.setup {
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
local null_ls = require("null-ls")

View File

@ -1,15 +1,13 @@
-- nvim-autopairs
require('nvim-autopairs').setup{}
require('nvim-autopairs').setup {}
-- you need setup cmp first put this after cmp.setup()
require("cmp").setup({
map_cr = false, -- map <CR> on insert mode
map_complete = false, -- it will auto insert `(` after select function or method item
auto_select = true -- automatically select the first item
map_cr = false, -- map <CR> on insert mode
map_complete = false, -- it will auto insert `(` after select function or method item
auto_select = true -- automatically select the first item
})
------
--nvim-ts-autotag
require'nvim-treesitter.configs'.setup {
autotag = {
enable = true,
}
}
-- nvim-ts-autotag
require'nvim-treesitter.configs'.setup {autotag = {enable = true}}
------