flippity fuck
This commit is contained in:
parent
e9a8b28907
commit
d5faa08253
11 changed files with 201 additions and 57 deletions
|
@ -1,12 +1,50 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
js = { "prettierd" },
|
||||
html = { "prettierd" },
|
||||
c = { "clang-format" },
|
||||
cpp = { "clang-format" },
|
||||
},
|
||||
},
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
init = function()
|
||||
require "conform".setup(
|
||||
{
|
||||
format_on_save = function(bufnr)
|
||||
require("conform").formatters_by_ft = require "mason-bridge".get_formatters()
|
||||
return { timeout_ms = 200, lsp_fallback = true }, on_format
|
||||
end,
|
||||
formatters_by_ft = require("mason-bridge").get_formatters(), --[[ = {
|
||||
lua = { "stylua" },
|
||||
javascript = { "prettier" },
|
||||
html = { "prettier" },
|
||||
css = { "prettier" },
|
||||
c = { "clang-format" },
|
||||
cpp = { "clang-format" },
|
||||
arduino = { "clang-format" },
|
||||
sh = { "shfmt" },
|
||||
bash = { "shfmt" },
|
||||
mksh = { "shfmt" },
|
||||
json = { "jq" },
|
||||
}, ]] --
|
||||
|
||||
-- This will provide type hinting with LuaLS
|
||||
---@module "conform"
|
||||
---@type conform.setupOpts
|
||||
formatters = {
|
||||
prettier = {
|
||||
prepend_args = { "--use-tabs", "true" },
|
||||
},
|
||||
jq = {
|
||||
prepend_args = { "--tab" },
|
||||
},
|
||||
["clang-format"] = {
|
||||
prepend_args = function(self, ctx)
|
||||
return { "-style=file:/home/Dario48/.config/.clang-format" }
|
||||
end,
|
||||
},
|
||||
default_format_opts = {
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
},
|
||||
})
|
||||
-- If you want the formatexpr, here is the place to set it
|
||||
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||
vim.g.arduino_recommended_style = 0
|
||||
end,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue