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",
|
"html",
|
||||||
"jsonls",
|
"jsonls",
|
||||||
"pyright",
|
"pyright",
|
||||||
-- "remark_ls",
|
"rust_analyzer",
|
||||||
"sourcery",
|
"sourcery",
|
||||||
"stylelint_lsp",
|
"stylelint_lsp",
|
||||||
"sumneko_lua",
|
"sumneko_lua",
|
||||||
@@ -22,6 +22,7 @@ local servers = {
|
|||||||
"theme_check",
|
"theme_check",
|
||||||
"tsserver",
|
"tsserver",
|
||||||
"vuels",
|
"vuels",
|
||||||
|
-- "remark_ls",
|
||||||
}
|
}
|
||||||
|
|
||||||
lsp_installer.settings({
|
lsp_installer.settings({
|
||||||
|
|||||||
@@ -126,6 +126,11 @@ M.on_attach = function(client, bufnr)
|
|||||||
client.resolved_capabilities.document_range_formatting = false
|
client.resolved_capabilities.document_range_formatting = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Rust
|
||||||
|
if client.name == "rust_analyzer" then
|
||||||
|
client.resolved_capabilities.document_formatting = false
|
||||||
|
end
|
||||||
|
|
||||||
lsp_keymaps(bufnr)
|
lsp_keymaps(bufnr)
|
||||||
lsp_highlight_document(client)
|
lsp_highlight_document(client)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ null_ls.setup({
|
|||||||
formatting.stylua, -- Lua
|
formatting.stylua, -- Lua
|
||||||
formatting.trim_newlines,
|
formatting.trim_newlines,
|
||||||
formatting.trim_whitespace,
|
formatting.trim_whitespace,
|
||||||
|
formatting.rustfmt,
|
||||||
hover.dictionary,
|
hover.dictionary,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ end
|
|||||||
|
|
||||||
-- Have packer use a popup window
|
-- Have packer use a popup window
|
||||||
packer.init({
|
packer.init({
|
||||||
max_jobs= 8,
|
max_jobs = 8,
|
||||||
display = {
|
display = {
|
||||||
open_fn = function()
|
open_fn = function()
|
||||||
return require("packer.util").float({
|
return require("packer.util").float({
|
||||||
@@ -142,6 +142,7 @@ return packer.startup(function(use)
|
|||||||
use("rstacruz/vim-xtract") -- Extract code into new file
|
use("rstacruz/vim-xtract") -- Extract code into new file
|
||||||
use("tpope/vim-repeat") -- Repeat plugins
|
use("tpope/vim-repeat") -- Repeat plugins
|
||||||
use("tpope/vim-surround") -- Replace, add, remove surroundings
|
use("tpope/vim-surround") -- Replace, add, remove surroundings
|
||||||
|
use("mfussenegger/nvim-dap") -- Debug Adapter Protocol
|
||||||
|
|
||||||
-- Custom Text Objects
|
-- Custom Text Objects
|
||||||
use("christoomey/vim-titlecase")
|
use("christoomey/vim-titlecase")
|
||||||
|
|||||||
Reference in New Issue
Block a user