Update formatters and fix slow load bug with rustfmt
This commit is contained in:
parent
03f906b663
commit
b2d372c538
6 changed files with 25 additions and 14 deletions
|
|
@ -1,8 +1,5 @@
|
|||
-- Formatting configuration
|
||||
|
||||
-- Set rustfmt command
|
||||
vim.g["rustfmt_command"] = "rustfmt +nightly"
|
||||
|
||||
-- Commands to disable/enable formatting
|
||||
require("conform").setup({
|
||||
format_on_save = function(bufnr)
|
||||
|
|
@ -31,4 +28,5 @@ vim.api.nvim_create_user_command("FormatEnable", function()
|
|||
vim.g.disable_autoformat = false
|
||||
end, {
|
||||
desc = "Re-enable autoformat-on-save",
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -16,4 +16,5 @@ vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower win
|
|||
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })
|
||||
|
||||
-- LSP keymaps
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Goto Definition" })
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Goto Definition" })
|
||||
|
||||
|
|
|
|||
|
|
@ -9,13 +9,22 @@ return {
|
|||
command = "black",
|
||||
prepend_args = { "--line-length", "100" },
|
||||
},
|
||||
"prettier",
|
||||
formatters = {
|
||||
golines = {
|
||||
args = {
|
||||
"--max-len=100",
|
||||
"--base-formatter=gofmt",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
notify_on_error = false,
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = false,
|
||||
timeout_ms = 2500,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
|
|
@ -25,7 +34,12 @@ return {
|
|||
sh = { "beautysh" },
|
||||
tex = { "latexindent" },
|
||||
java = { "java" },
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
typescriptreact = { "prettier" },
|
||||
json = { "prettier" },
|
||||
go = { "golines" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,6 +181,7 @@ return {
|
|||
"jdtls",
|
||||
"stylua",
|
||||
"black",
|
||||
"golines",
|
||||
"clang-format",
|
||||
"beautysh",
|
||||
"latexindent",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue