From 9499cc8072b41df2200095ea64a369858f783a0c Mon Sep 17 00:00:00 2001 From: poslop Date: Fri, 6 Feb 2026 14:29:42 -0600 Subject: [PATCH] luaformat --- lua/config/maps.lua | 4 ++++ lua/plugins/format.lua | 31 ++++++++++++++++++++++++------- readme.md | 7 +++++++ 3 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 readme.md diff --git a/lua/config/maps.lua b/lua/config/maps.lua index 8648125..2647cf4 100644 --- a/lua/config/maps.lua +++ b/lua/config/maps.lua @@ -1,3 +1,7 @@ local map = vim.keymap.set map("n", "e", "NvimTreeToggle", { desc = "NvimTree" }) + +map("n", "f", function() + require("conform").format { async = true } +end, { desc = "Format buffer" }) diff --git a/lua/plugins/format.lua b/lua/plugins/format.lua index d3babb6..8868a03 100644 --- a/lua/plugins/format.lua +++ b/lua/plugins/format.lua @@ -1,15 +1,32 @@ return { -{ + { 'windwp/nvim-autopairs', event = "InsertEnter", config = true -}, -{ - "folke/ts-comments.nvim", - event = "VeryLazy", - opts = {}, -}, + }, + { + "folke/ts-comments.nvim", + event = "VeryLazy", + opts = {}, + }, { "hrsh7th/nvim-cmp", + }, + { + 'stevearc/conform.nvim', + opts = { + formatters_by_ft = { + lua = { "stylua" }, + }, + default_format_opts = { + lsp_format = "fallback", + }, + format_on_save = { timeout_ms = 500 }, + formatters = { + shfmt = { + append_args = { "-i", "2" }, + }, + }, + }, } } diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..e03cff0 --- /dev/null +++ b/readme.md @@ -0,0 +1,7 @@ +### Dependencies + +Formatters + +``` +stylua +```