diff options
Diffstat (limited to 'nvim/lua/plugins/format.lua')
| -rw-r--r-- | nvim/lua/plugins/format.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua index b8b0256..9334465 100644 --- a/nvim/lua/plugins/format.lua +++ b/nvim/lua/plugins/format.lua | |||
| @@ -5,18 +5,17 @@ return { | |||
| 5 | { | 5 | { |
| 6 | "<leader>cf", | 6 | "<leader>cf", |
| 7 | function() | 7 | function() |
| 8 | require("conform").format({ | 8 | require("conform").format({ async = true }) |
| 9 | async = true, | ||
| 10 | lsp_fallback = true, | ||
| 11 | }) | ||
| 12 | end, | 9 | end, |
| 13 | desc = "Format file", | 10 | desc = "Format file", |
| 14 | }, | 11 | }, |
| 15 | }, | 12 | }, |
| 16 | opts = { | 13 | opts = { |
| 17 | formatters_by_ft = { | 14 | formatters_by_ft = { |
| 15 | awk = { "gawk" }, -- pkg install gawk | ||
| 18 | bash = { "shfmt" }, | 16 | bash = { "shfmt" }, |
| 19 | -- cpp = { "clang_format" }, | 17 | c = {}, -- clangd |
| 18 | cpp = {}, -- clangd | ||
| 20 | javascript = { "prettier" }, | 19 | javascript = { "prettier" }, |
| 21 | json = { "jq" }, -- brew install jq, pkg install jq | 20 | json = { "jq" }, -- brew install jq, pkg install jq |
| 22 | lua = { "stylua" }, -- brew install stylua, pkg install stylua | 21 | lua = { "stylua" }, -- brew install stylua, pkg install stylua |
| @@ -27,6 +26,9 @@ return { | |||
| 27 | xsd = { "xmllint" }, | 26 | xsd = { "xmllint" }, |
| 28 | yaml = { "yamlfmt" }, -- brew install yamlfmt, pkg install yamlfmt | 27 | yaml = { "yamlfmt" }, -- brew install yamlfmt, pkg install yamlfmt |
| 29 | }, | 28 | }, |
| 29 | default_format_opts = { | ||
| 30 | lsp_format = "fallback", | ||
| 31 | }, | ||
| 30 | }, | 32 | }, |
| 31 | 33 | ||
| 32 | config = function(_, opts) | 34 | config = function(_, opts) |
