mirror of
https://github.com/tomru/vim.git
synced 2026-03-03 22:47:25 +01:00
add all previous plugins and config
This commit is contained in:
38
lua/custom/plugins/formatter.lua
Normal file
38
lua/custom/plugins/formatter.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user