1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2026-03-28 18:34:46 +01:00
Files
dotfiles/.config/nvim/lua/plugins/tidy.lua

23 lines
523 B
Lua

return {
-- clean up white spaces and empty lines before writing
"mcauley-penney/tidy.nvim",
branch = "main",
ft = { "markdown", "tex" },
opts = {
filetype_exclude = { "diff" },
},
config = function(_, opts)
local tidy = require("tidy")
tidy.setup(opts)
tidy.opts.enabled_on_save = false
vim.api.nvim_create_autocmd("BufLeave", {
pattern = { "*.md", "*.tex" },
callback = function()
if vim.bo.modifiable then
tidy.run()
end
end,
})
end,
}