chore(nvim): add Rust formatting and setup

This commit is contained in:
Stefan Imhoff
2022-08-05 17:35:43 +02:00
parent 0d8af82dd5
commit b19616ab49
4 changed files with 10 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ local servers = {
"html",
"jsonls",
"pyright",
-- "remark_ls",
"rust_analyzer",
"sourcery",
"stylelint_lsp",
"sumneko_lua",
@@ -22,6 +22,7 @@ local servers = {
"theme_check",
"tsserver",
"vuels",
-- "remark_ls",
}
lsp_installer.settings({

View File

@@ -126,6 +126,11 @@ M.on_attach = function(client, bufnr)
client.resolved_capabilities.document_range_formatting = false
end
-- Rust
if client.name == "rust_analyzer" then
client.resolved_capabilities.document_formatting = false
end
lsp_keymaps(bufnr)
lsp_highlight_document(client)
end

View File

@@ -44,6 +44,7 @@ null_ls.setup({
formatting.stylua, -- Lua
formatting.trim_newlines,
formatting.trim_whitespace,
formatting.rustfmt,
hover.dictionary,
},
})

View File

@@ -32,7 +32,7 @@ end
-- Have packer use a popup window
packer.init({
max_jobs= 8,
max_jobs = 8,
display = {
open_fn = function()
return require("packer.util").float({
@@ -142,6 +142,7 @@ return packer.startup(function(use)
use("rstacruz/vim-xtract") -- Extract code into new file
use("tpope/vim-repeat") -- Repeat plugins
use("tpope/vim-surround") -- Replace, add, remove surroundings
use("mfussenegger/nvim-dap") -- Debug Adapter Protocol
-- Custom Text Objects
use("christoomey/vim-titlecase")