summaryrefslogtreecommitdiff
path: root/conform.lua
diff options
context:
space:
mode:
authorfilip <“filip.rabiega@gmail.com”>2026-02-04 16:34:45 +0100
committerfilip <“filip.rabiega@gmail.com”>2026-02-04 16:34:45 +0100
commit7a7a8ace1dacfff121ce90110c7b5c8635d178c3 (patch)
treea90d1abf42f5b4ea8917e57a02a482ed32a4fae8 /conform.lua
downloadlazy-plugins-7a7a8ace1dacfff121ce90110c7b5c8635d178c3.tar.gz
lazy-plugins-7a7a8ace1dacfff121ce90110c7b5c8635d178c3.tar.bz2
lazy-plugins-7a7a8ace1dacfff121ce90110c7b5c8635d178c3.zip
plugin dump
Diffstat (limited to 'conform.lua')
-rw-r--r--conform.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/conform.lua b/conform.lua
new file mode 100644
index 0000000..82e76b8
--- /dev/null
+++ b/conform.lua
@@ -0,0 +1,23 @@
+return {
+ "stevearc/conform.nvim",
+ -- event = { "BufReadPre", "BufNewFile" }, -- Load when you open a file
+ config = function()
+ local conform = require("conform")
+
+ conform.setup({
+ formatters_by_ft = {
+ -- Assign formatters to specific filetypes
+ python = { "isort", "black" },
+ tex = { "tex-fmt" },
+ lua = { "stylua" },
+ sh = { "shfmt" },
+ },
+ -- This is the "Magic" part: Format on Save
+ format_on_save = {
+ lsp_fallback = true, -- Use LSP if no dedicated formatter is found
+ async = false, -- Formatting must be synchronous to save correctly
+ timeout_ms = 1000, -- Don't hang the UI for more than 0.5s
+ },
+ })
+ end,
+}