Привёл nvim к достаточному состоянию
This commit is contained in:
parent
020ed86034
commit
4d3bb0270a
27 changed files with 279 additions and 148 deletions
29
nvim/lua/plugins/format.lua
Normal file
29
nvim/lua/plugins/format.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
local conform = require("conform")
|
||||
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
javascriptreact = { "prettier" },
|
||||
typescriptreact = { "prettier" },
|
||||
svelte = { "prettier" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
json = { "prettier" },
|
||||
yaml = { "prettier" },
|
||||
markdown = { "prettier" },
|
||||
graphql = { "prettier" },
|
||||
lua = { "stylua" },
|
||||
python = { "isort", "black" },
|
||||
go = { "gofmt" },
|
||||
},
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 500,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
|
||||
conform.format({ lsp_fallback = true, async = false, timeout_ms = 500 })
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
Loading…
Add table
Add a link
Reference in a new issue