Files
3dev-dotfiles/lua/plugins/formatters.lua
2024-08-15 16:19:14 +04:00

28 lines
673 B
Lua

return {
"stevearc/conform.nvim",
opts = {},
config = function()
require("conform").setup({
formatters_by_ft = {
lua = { "stylua" },
python = { "isort", "ruff_format" },
javascript = { "prettier" },
typescript = { "prettier" },
javascriptreact = { "prettier" },
typescriptreact = { "prettier" },
css = { "prettier" },
html = { "prettier" },
json = { "prettier" },
yaml = { "prettier" },
},
})
vim.api.nvim_set_keymap(
"n",
"<Leader>f",
":lua require('conform').format()<CR>",
{ noremap = true, silent = true }
)
end,
keys = "<leader>f", -- Optionally specify here to load the plugin on this keypress
}