mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-18 08:18:24 +02:00
Added default formatters (#908)
* added default formatters for a couple of langs * fix: sugesstions from tastyep * allow users to change default formatters * suggestion: mellow pointed out the telescope issue * we don't need to use formatter.setup
This commit is contained in:
parent
6bbc082f57
commit
de7ec62f5f
16 changed files with 164 additions and 38 deletions
|
@ -1,11 +1,9 @@
|
|||
O.formatters.filetype["lua"] = {
|
||||
-- prettier
|
||||
function()
|
||||
return {
|
||||
exe = "stylua",
|
||||
-- TODO: append to this for args don't overwrite
|
||||
args = {},
|
||||
stdin = false,
|
||||
exe = O.lang.lua.formatter.exe,
|
||||
args = O.lang.lua.formatter.args,
|
||||
stdin = not (O.lang.lua.formatter.stdin ~= nil),
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
@ -48,16 +46,4 @@ if not require("lv-utils").check_lsp_client_active "sumneko_lua" then
|
|||
}
|
||||
end
|
||||
|
||||
if O.lang.lua.autoformat then
|
||||
require("lv-utils").define_augroups {
|
||||
_lua_autoformat = {
|
||||
{
|
||||
"BufWritePre",
|
||||
"*.lua",
|
||||
"lua vim.lsp.buf.formatting_sync(nil, 1000)",
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
vim.cmd "setl ts=2 sw=2"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue