aboutsummaryrefslogtreecommitdiff
path: root/nvim/lua/plugins/format.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nvim/lua/plugins/format.lua')
-rw-r--r--nvim/lua/plugins/format.lua92
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
3local clang = {} 3local clang = {}
4local gawk = { "gawk" } -- brew install gawk, pkg install gawk 4local gawk = { "gawk" } -- brew install gawk, pkg install gawk
5local jq = { "jq" } -- brew install jq, pkg install jq 5local jq = { "jq" } -- brew install jq, pkg install jq
6local prettier = { "prettier" } -- npm install -g prettier 6local prettier = { "prettier" } -- npm install -g prettier
7local ruff = { "ruff_format" } -- brew install ruff, pkg install ruff 7local ruff = { "ruff_format" } -- brew install ruff, pkg install ruff
8local shfmt = { "shfmt" } -- brew install shfmt, pkg install shfmt 8local shfmt = { "shfmt" } -- brew install shfmt, pkg install shfmt
9local stylua = { "stylua" } -- brew install stylua, pkg install stylua 9local stylua = { "stylua" } -- brew install stylua, pkg install stylua
10local xmllint = { "xmllint" } -- xmllint ist Teil von libxml2 (standardmäßig installiert unter MacOS; pkg install libxml2) 10local xmllint = { "xmllint" } -- xmllint ist Teil von libxml2 (standardmäßig installiert unter MacOS; pkg install libxml2)
11local yamlfmt = { "yamlfmt" } -- brew install yamlfmt, pkg install yamlfmt 11local yamlfmt = { "yamlfmt" } -- brew install yamlfmt, pkg install yamlfmt
12 12
13return { 13return {
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}