aboutsummaryrefslogtreecommitdiff
path: root/nvim/lua/plugins
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2026-09-07 12:00:01 +0200
committerThomas Schmucker <ts@its1.de>2026-09-08 07:57:54 +0200
commit5e96d26780a13a10e318b517d292fbc315de15ca (patch)
treeec7c11391ade0ad7a05fd9cadf5346c7efa50a67 /nvim/lua/plugins
parent376da7a9630e457983209cada1f989f53e7731af (diff)
downloaddotfiles-5e96d26780a13a10e318b517d292fbc315de15ca.tar.gz
dotfiles-5e96d26780a13a10e318b517d292fbc315de15ca.tar.bz2
dotfiles-5e96d26780a13a10e318b517d292fbc315de15ca.zip
Unterstützung für jsonc
Diffstat (limited to 'nvim/lua/plugins')
-rw-r--r--nvim/lua/plugins/format.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua
index ce3f4e7..714e887 100644
--- a/nvim/lua/plugins/format.lua
+++ b/nvim/lua/plugins/format.lua
@@ -11,6 +11,15 @@ local stylua = { "stylua" } -- brew install stylua, pkg install stylua
11local xmllint = { "xmllint" } -- xmllint ist Teil von libxml2 (standardmäßig installiert unter MacOS; pkg install libxml2) 11local xmllint = { "xmllint" } -- xmllint ist Teil von libxml2 (standardmäßig installiert unter MacOS; pkg install libxml2)
12local yamlfmt = { "yamlfmt" } -- brew install yamlfmt, pkg install yamlfmt 12local yamlfmt = { "yamlfmt" } -- brew install yamlfmt, pkg install yamlfmt
13 13
14-- prettier leitet den Parser aus dem Dateinamen ab: .json landet beim strikten
15-- json-Parser, der Kommentare ablehnt. Im Filetype jsonc erzwingen wir deshalb
16-- den kommentartoleranten jsonc-Parser (prettier >= 3.0).
17local function prettier_parser_args(_, ctx)
18 if vim.bo[ctx.buf].filetype == "jsonc" then return { "--parser", "jsonc" } end
19
20 return {}
21end
22
14return { 23return {
15 "stevearc/conform.nvim", 24 "stevearc/conform.nvim",
16 event = { "BufReadPre", "BufNewFile" }, 25 event = { "BufReadPre", "BufNewFile" },
@@ -42,6 +51,11 @@ return {
42 xsd = xmllint, 51 xsd = xmllint,
43 yaml = yamlfmt, 52 yaml = yamlfmt,
44 }, 53 },
54 formatters = {
55 prettier = {
56 prepend_args = prettier_parser_args,
57 },
58 },
45 default_format_opts = { 59 default_format_opts = {
46 lsp_format = "fallback", 60 lsp_format = "fallback",
47 }, 61 },