mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
chore(nvim): add Rust formatting and setup
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -44,6 +44,7 @@ null_ls.setup({
|
||||
formatting.stylua, -- Lua
|
||||
formatting.trim_newlines,
|
||||
formatting.trim_whitespace,
|
||||
formatting.rustfmt,
|
||||
hover.dictionary,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user