formatting, completion, lsp
This commit is contained in:
29
nvim/lua/plugins/conform.lua
Normal file
29
nvim/lua/plugins/conform.lua
Normal file
@ -0,0 +1,29 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
keys = {
|
||||
{
|
||||
"<leader>cf",
|
||||
function()
|
||||
require("conform").format({ lsp_format = "fallback" })
|
||||
end,
|
||||
desc = "[C]ode [F]ormat",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
-- Conform will run multiple formatters sequentially
|
||||
python = { "isort", "black" },
|
||||
-- You can customize some of the format options for the filetype (:help conform.format)
|
||||
rust = { "rustfmt" },
|
||||
-- Conform will run the first available formatter
|
||||
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
typescript = { "prettierd", "prettier", stop_after_first = true },
|
||||
format_on_save = {
|
||||
-- These options will be passed to conform.format()
|
||||
timeout_ms = 500,
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user