mirror of
https://github.com/tomru/vim.git
synced 2026-03-03 14:37:20 +01:00
39 lines
879 B
Lua
39 lines
879 B
Lua
return {
|
|
"mhartington/formatter.nvim",
|
|
lazy = false,
|
|
init = function()
|
|
vim.api.nvim_create_augroup('_formatter', { clear = true });
|
|
vim.api.nvim_create_autocmd('BufWritePost', {
|
|
command = 'FormatWrite',
|
|
group = '_formatter',
|
|
})
|
|
end,
|
|
opts = function()
|
|
local filetypes = require('formatter.filetypes')
|
|
return {
|
|
logging = false,
|
|
log_level = vim.log.levels.WARN,
|
|
filetype = {
|
|
lua = {
|
|
filetypes.lua.stylua,
|
|
},
|
|
javascript = {
|
|
filetypes.javascript.eslint_d,
|
|
},
|
|
javascriptreact = {
|
|
filetypes.javascript.eslint_d,
|
|
},
|
|
json = {
|
|
filetypes.json.prettierd,
|
|
},
|
|
rust = {
|
|
filetypes.rust.rustfmt,
|
|
},
|
|
['*'] = {
|
|
filetypes.any.remove_trailing_whitespace,
|
|
},
|
|
},
|
|
}
|
|
end
|
|
}
|