Added formatting, linter, and mason_tool_install

This commit is contained in:
Jeremie Fraeys 2023-11-02 12:44:53 -04:00
parent c54236b7ac
commit 8bce42bec4
5 changed files with 206 additions and 23 deletions

View file

@ -0,0 +1,25 @@
return {
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
local conform = require("conform")
conform.setup({
formatters_by_ft = {
python = { "isort", "black" },
},
format_on_save = {
lsp_fallback = true,
async = false,
timeout_ms = 500,
},
})
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 500,
})
end, { desc = "Format file or range (in visual mode)" })
end,
}