diff options
Diffstat (limited to 'nvim/lua/plugins')
| -rw-r--r-- | nvim/lua/plugins/format.lua | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua index 9b1309a..3d6d5b0 100644 --- a/nvim/lua/plugins/format.lua +++ b/nvim/lua/plugins/format.lua | |||
| @@ -5,28 +5,29 @@ 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 = { |
| 18 | awk = { "gawk" }, -- pkg install gawk | 15 | awk = { "gawk" }, -- pkg install gawk |
| 19 | bash = { "shfmt" }, | 16 | bash = { "shfmt" }, |
| 20 | -- cpp = { "clang_format" }, | 17 | c = {}, -- clangd |
| 18 | cpp = {}, -- clangd | ||
| 21 | javascript = { "prettier" }, | 19 | javascript = { "prettier" }, |
| 22 | json = { "jq" }, -- brew install jq, pkg install jq | 20 | json = { "jq" }, -- brew install jq, pkg install jq |
| 23 | lua = { "stylua" }, -- brew install stylua, pkg install stylua | 21 | lua = { "stylua" }, -- brew install stylua, pkg install stylua |
| 24 | python = { "ruff_format" }, -- brew install ruff, pkg install ruff | 22 | python = { "ruff_format" }, -- brew install ruff, pkg install ruff |
| 25 | sh = { "shfmt" }, -- brew install, pkg install shfmt | 23 | sh = { "shfmt" }, -- brew install, pkg install shfmt |
| 26 | typescript = { "prettier" }, -- npm install -g prettier | 24 | typescript = { "prettier" }, -- npm install -g prettier |
| 27 | xml = { "xmllint" }, -- xmllint ist Teil von libxml2 | 25 | xml = { "xmllint" }, -- xmllint ist Teil von libxml2 |
| 28 | xsd = { "xmllint" }, | 26 | xsd = { "xmllint" }, |
| 29 | yaml = { "yamlfmt" }, -- brew install yamlfmt, pkg install yamlfmt | 27 | yaml = { "yamlfmt" }, -- brew install yamlfmt, pkg install yamlfmt |
| 28 | }, | ||
| 29 | default_format_opts = { | ||
| 30 | lsp_format = "fallback", | ||
| 30 | }, | 31 | }, |
| 31 | }, | 32 | }, |
| 32 | 33 | ||
