fix: Rust formatter

This commit is contained in:
Fabio Lenherr / DashieTM 2023-12-01 10:24:21 +01:00
parent a78598a2a1
commit d9fa7807db
7 changed files with 52 additions and 59 deletions

View file

@ -3,26 +3,13 @@ return {
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
diagnostics = {
underline = true,
update_in_insert = false,
virtual_text = { spacing = 4, source = "if_many", prefix = "" },
severity_sort = true,
},
-- inlay_hints = {
-- enabled = true,
-- },
capabilities = {},
format_notify = false,
format = {
formatting_options = nil,
timeout_ms = nil,
},
-- LSP Server Settings
---@type lspconfig.options
servers = {
cssls = {},
html = {},
bashls = {},
ansiblels = {},
asm_lsp = {},
@ -83,16 +70,21 @@ return {
},
{
"stevearc/conform.nvim",
opts = function()
local opts = {
formatters_by_ft = {
lua = { "stylua" },
fish = { "fish_indent" },
sh = { "shfmt" },
typst = { "typstfmt" },
opts = {
keys = {
{
-- Customize or remove this keymap to your liking
"<leader>cF",
function()
require("conform").format({ async = true, lsp_fallback = true })
end,
mode = "",
desc = "Format buffer",
},
}
return opts
end,
},
formatters_by_ft = {
typst = { "typstfmt" },
},
},
},
}