diff options
Diffstat (limited to 'nvim/lua/plugins/format.lua')
| -rw-r--r-- | nvim/lua/plugins/format.lua | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua index 102326c..8ca7f1b 100644 --- a/nvim/lua/plugins/format.lua +++ b/nvim/lua/plugins/format.lua | |||
| @@ -1,46 +1,46 @@ | |||
| 1 | -- Verfügbare Formater: https://github.com/stevearc/conform.nvim/tree/master/lua/conform/formatters | 1 | -- Verfügbare Formater: https://github.com/stevearc/conform.nvim/tree/master/lua/conform/formatters |
| 2 | 2 | ||
| 3 | local clang = {} | 3 | local clang = {} |
| 4 | local gawk = { "gawk" } -- brew install gawk, pkg install gawk | 4 | local gawk = { "gawk" } -- brew install gawk, pkg install gawk |
| 5 | local jq = { "jq" } -- brew install jq, pkg install jq | 5 | local jq = { "jq" } -- brew install jq, pkg install jq |
| 6 | local prettier = { "prettier" } -- npm install -g prettier | 6 | local prettier = { "prettier" } -- npm install -g prettier |
| 7 | local ruff = { "ruff_format" } -- brew install ruff, pkg install ruff | 7 | local ruff = { "ruff_format" } -- brew install ruff, pkg install ruff |
| 8 | local shfmt = { "shfmt" } -- brew install shfmt, pkg install shfmt | 8 | local shfmt = { "shfmt" } -- brew install shfmt, pkg install shfmt |
| 9 | local stylua = { "stylua" } -- brew install stylua, pkg install stylua | 9 | local stylua = { "stylua" } -- brew install stylua, pkg install stylua |
| 10 | local xmllint = { "xmllint" } -- xmllint ist Teil von libxml2 (standardmäßig installiert unter MacOS; pkg install libxml2) | 10 | local xmllint = { "xmllint" } -- xmllint ist Teil von libxml2 (standardmäßig installiert unter MacOS; pkg install libxml2) |
| 11 | local yamlfmt = { "yamlfmt" } -- brew install yamlfmt, pkg install yamlfmt | 11 | local yamlfmt = { "yamlfmt" } -- brew install yamlfmt, pkg install yamlfmt |
| 12 | 12 | ||
| 13 | return { | 13 | return { |
| 14 | "stevearc/conform.nvim", | 14 | "stevearc/conform.nvim", |
| 15 | event = { "BufReadPre", "BufNewFile" }, | 15 | event = { "BufReadPre", "BufNewFile" }, |
| 16 | keys = { | 16 | keys = { |
| 17 | { | 17 | { |
| 18 | "<leader>cf", | 18 | "<leader>cf", |
| 19 | function() | 19 | function() |
| 20 | require("conform").format({ async = true }) | 20 | require("conform").format({ async = true }) |
| 21 | end, | 21 | end, |
| 22 | desc = "Format file", | 22 | desc = "Format file", |
| 23 | }, | 23 | }, |
| 24 | }, | 24 | }, |
| 25 | opts = { | 25 | opts = { |
| 26 | formatters_by_ft = { | 26 | formatters_by_ft = { |
| 27 | awk = gawk, | 27 | awk = gawk, |
| 28 | bash = shfmt, | 28 | bash = shfmt, |
| 29 | c = clang, | 29 | c = clang, |
| 30 | cpp = clang, | 30 | cpp = clang, |
| 31 | html = prettier, | 31 | html = prettier, |
| 32 | javascript = prettier, | 32 | javascript = prettier, |
| 33 | json = jq, | 33 | json = jq, |
| 34 | lua = stylua, | 34 | lua = stylua, |
| 35 | python = ruff, | 35 | python = ruff, |
| 36 | sh = shfmt, | 36 | sh = shfmt, |
| 37 | typescript = prettier, | 37 | typescript = prettier, |
| 38 | xml = xmllint, | 38 | xml = xmllint, |
| 39 | xsd = xmllint, | 39 | xsd = xmllint, |
| 40 | yaml = yamlfmt, | 40 | yaml = yamlfmt, |
| 41 | }, | 41 | }, |
| 42 | default_format_opts = { | 42 | default_format_opts = { |
| 43 | lsp_format = "fallback", | 43 | lsp_format = "fallback", |
| 44 | }, | 44 | }, |
| 45 | }, | 45 | }, |
| 46 | } | 46 | } |
