aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2024-05-03 14:27:26 +0100
committerJuan J. Martinez <jjm@usebox.net>2024-05-03 14:27:26 +0100
commit4a04c8dae449bf983342e1647f963644156dac74 (patch)
tree5864f544a21ccc1842c1b93100bd0c0ec790c3bb
parentd16de57d96bd99772dcc2253d4fa0f334071006e (diff)
downloaddotnvim-4a04c8dae449bf983342e1647f963644156dac74.tar.gz
dotnvim-4a04c8dae449bf983342e1647f963644156dac74.zip
Added rust LSP, cleaned up a little
-rw-r--r--lsp.lua40
-rw-r--r--plugins.vim3
2 files changed, 30 insertions, 13 deletions
diff --git a/lsp.lua b/lsp.lua
index fabb8d5..5ffce6d 100644
--- a/lsp.lua
+++ b/lsp.lua
@@ -34,16 +34,16 @@ end
-- better UI
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
- vim.lsp.handlers.hover, {
- -- Use a sharp border with `FloatBorder` highlights
- border = "single"
- }
+vim.lsp.handlers.hover, {
+ -- Use a sharp border with `FloatBorder` highlights
+ border = "single"
+}
)
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
- vim.lsp.handlers.signature_help, {
- -- Use a sharp border with `FloatBorder` highlights
- border = "single"
- }
+vim.lsp.handlers.signature_help, {
+ -- Use a sharp border with `FloatBorder` highlights
+ border = "single"
+}
)
-- Use a loop to conveniently call 'setup' on multiple servers and
@@ -70,14 +70,28 @@ local servers = {
lua_ls = {
lua_ls = { },
},
+ rust_analyzer = {
+ ["rust-analyzer"] = {
+ imports = {
+ granularity = {
+ group = "module",
+ },
+ prefix = "self",
+ },
+ cargo = {
+ buildScripts = {
+ enable = true,
+ },
+ },
+ procMacro = {
+ enable = true
+ },
+ },
+ },
}
for lsp, settings in pairs(servers) do
require('lspconfig')[lsp].setup {
on_attach = on_attach,
- flags = {
- -- This will be the default in neovim 0.7+
- debounce_text_changes = 150,
- },
settings = settings,
}
end
@@ -88,5 +102,5 @@ vim.diagnostic.config({ virtual_text = true, signs = true })
require("trouble").setup()
vim.api.nvim_set_keymap("n", "<leader>xx", "<cmd>TroubleToggle<cr>",
- {silent = true, noremap = true}
+{silent = true, noremap = true}
)
diff --git a/plugins.vim b/plugins.vim
index 825ac8b..e122a46 100644
--- a/plugins.vim
+++ b/plugins.vim
@@ -35,6 +35,9 @@ Plug 'nvim-lua/plenary.nvim'
" scala
Plug 'scalameta/nvim-metals'
+" rust
+Plug 'rust-lang/rust.vim'
+
" telescope
Plug 'nvim-telescope/telescope.nvim'