luaformat

This commit is contained in:
2026-02-06 14:29:42 -06:00
parent 4126124208
commit 9499cc8072
3 changed files with 35 additions and 7 deletions

View File

@@ -1,3 +1,7 @@
local map = vim.keymap.set
map("n", "<leader>e", "<cmd>NvimTreeToggle<CR>", { desc = "NvimTree" })
map("n", "<leader>f", function()
require("conform").format { async = true }
end, { desc = "Format buffer" })

View File

@@ -11,5 +11,22 @@ return {
},
{
"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" },
},
},
},
}
}

7
readme.md Normal file
View File

@@ -0,0 +1,7 @@
### Dependencies
Formatters
```
stylua
```