diff options
| author | Thomas Schmucker <ts@its1.de> | 2026-09-07 11:31:58 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2026-09-08 07:53:26 +0200 |
| commit | f63403e394c3fb52827b9362cd31a0a3bdbf08ec (patch) | |
| tree | 2987984cf9ad9c5b52a8c7f083c48adc7efe2845 /nvim | |
| parent | 6889a8dd32cc7b2982bd46450bcb9654929023cb (diff) | |
| download | dotfiles-f63403e394c3fb52827b9362cd31a0a3bdbf08ec.tar.gz dotfiles-f63403e394c3fb52827b9362cd31a0a3bdbf08ec.tar.bz2 dotfiles-f63403e394c3fb52827b9362cd31a0a3bdbf08ec.zip | |
Unterstützung für jsonc
Diffstat (limited to 'nvim')
| -rw-r--r-- | nvim/ftplugin/json.lua | 8 | ||||
| -rw-r--r-- | nvim/ftplugin/jsonc.lua | 5 | ||||
| -rw-r--r-- | nvim/lua/config/filetypes.lua | 1 | ||||
| -rw-r--r-- | nvim/lua/config/treesitter.lua | 3 | ||||
| -rw-r--r-- | nvim/lua/plugins/format.lua | 1 |
5 files changed, 12 insertions, 6 deletions
diff --git a/nvim/ftplugin/json.lua b/nvim/ftplugin/json.lua index a6321ff..73b5935 100644 --- a/nvim/ftplugin/json.lua +++ b/nvim/ftplugin/json.lua | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | local opt = vim.opt_local | 1 | -- Standard-Dateityp für .json-Dateien ist "jsonc" (siehe lua/config/filetypes.lua). |
| 2 | 2 | -- Buffer, deren Dateityp explizit "json" ist, erben dieselben Einstellungen. | |
| 3 | opt.expandtab = true | 3 | vim.cmd("runtime! ftplugin/jsonc.lua") |
| 4 | opt.shiftwidth = 2 | ||
| 5 | opt.tabstop = 2 | ||
diff --git a/nvim/ftplugin/jsonc.lua b/nvim/ftplugin/jsonc.lua new file mode 100644 index 0000000..a6321ff --- /dev/null +++ b/nvim/ftplugin/jsonc.lua | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | local opt = vim.opt_local | ||
| 2 | |||
| 3 | opt.expandtab = true | ||
| 4 | opt.shiftwidth = 2 | ||
| 5 | opt.tabstop = 2 | ||
diff --git a/nvim/lua/config/filetypes.lua b/nvim/lua/config/filetypes.lua index 3161d40..37b1b65 100644 --- a/nvim/lua/config/filetypes.lua +++ b/nvim/lua/config/filetypes.lua | |||
| @@ -37,6 +37,7 @@ vim.treesitter.language.register("yaml", M.ANSIBLE_YAML) | |||
| 37 | vim.filetype.add({ | 37 | vim.filetype.add({ |
| 38 | extension = { | 38 | extension = { |
| 39 | j2 = "jinja", | 39 | j2 = "jinja", |
| 40 | json = "jsonc", | ||
| 40 | }, | 41 | }, |
| 41 | }) | 42 | }) |
| 42 | 43 | ||
diff --git a/nvim/lua/config/treesitter.lua b/nvim/lua/config/treesitter.lua index f122f37..de71d50 100644 --- a/nvim/lua/config/treesitter.lua +++ b/nvim/lua/config/treesitter.lua | |||
| @@ -10,7 +10,8 @@ M.languages = { | |||
| 10 | -- "jinja", | 10 | -- "jinja", |
| 11 | -- "jinja_inline", | 11 | -- "jinja_inline", |
| 12 | "jq", | 12 | "jq", |
| 13 | "json", | 13 | "json", -- weiterhin nötig für Injections, z.B. ```json in Markdown |
| 14 | "jsonc", | ||
| 14 | "lua", | 15 | "lua", |
| 15 | "make", | 16 | "make", |
| 16 | "markdown", | 17 | "markdown", |
diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua index 8b40229..ce3f4e7 100644 --- a/nvim/lua/plugins/format.lua +++ b/nvim/lua/plugins/format.lua | |||
| @@ -33,6 +33,7 @@ return { | |||
| 33 | javascript = prettier, | 33 | javascript = prettier, |
| 34 | jinja = djlint, | 34 | jinja = djlint, |
| 35 | json = jq, | 35 | json = jq, |
| 36 | jsonc = prettier, | ||
| 36 | lua = stylua, | 37 | lua = stylua, |
| 37 | python = ruff, | 38 | python = ruff, |
| 38 | sh = shfmt, | 39 | sh = shfmt, |
