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