diff options
Diffstat (limited to 'nvim')
| -rw-r--r-- | nvim/ftplugin/json.lua | 8 | ||||
| -rw-r--r-- | nvim/ftplugin/jsonc.lua | 8 | ||||
| -rw-r--r-- | nvim/lua/config/filetypes.lua | 3 | ||||
| -rw-r--r-- | nvim/lua/config/treesitter.lua | 2 |
4 files changed, 9 insertions, 12 deletions
diff --git a/nvim/ftplugin/json.lua b/nvim/ftplugin/json.lua index 341b728..a6321ff 100644 --- a/nvim/ftplugin/json.lua +++ b/nvim/ftplugin/json.lua | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | -- Standard-Dateityp für .json-Dateien ist "jsonc" (siehe lua/config/filetypes.lua). | 1 | local opt = vim.opt_local |
| 2 | -- Buffer, deren Dateityp explizit "json" ist, erben dieselben Einstellungen. | 2 | |
| 3 | vim.cmd.runtime("ftplugin/jsonc.lua") | 3 | opt.expandtab = true |
| 4 | opt.shiftwidth = 2 | ||
| 5 | opt.tabstop = 2 | ||
diff --git a/nvim/ftplugin/jsonc.lua b/nvim/ftplugin/jsonc.lua index a6321ff..4c9fd66 100644 --- a/nvim/ftplugin/jsonc.lua +++ b/nvim/ftplugin/jsonc.lua | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | local opt = vim.opt_local | 1 | -- jsonc entsteht nicht durch Dateityp-Erkennung, sondern nur wenn es explizit |
| 2 | 2 | -- gesetzt wird (z.B. per Modeline). Die Einstellungen sind dieselben wie fuer json. | |
| 3 | opt.expandtab = true | 3 | vim.cmd.runtime("ftplugin/json.lua") |
| 4 | opt.shiftwidth = 2 | ||
| 5 | opt.tabstop = 2 | ||
diff --git a/nvim/lua/config/filetypes.lua b/nvim/lua/config/filetypes.lua index f95307f..1b85053 100644 --- a/nvim/lua/config/filetypes.lua +++ b/nvim/lua/config/filetypes.lua | |||
| @@ -4,8 +4,5 @@ | |||
| 4 | vim.filetype.add({ | 4 | vim.filetype.add({ |
| 5 | extension = { | 5 | extension = { |
| 6 | j2 = "jinja", | 6 | j2 = "jinja", |
| 7 | -- .json als jsonc behandeln, damit Kommentare erlaubt sind (jsonls meldet | ||
| 8 | -- sie dann nicht als Fehler). | ||
| 9 | json = "jsonc", | ||
| 10 | }, | 7 | }, |
| 11 | }) | 8 | }) |
diff --git a/nvim/lua/config/treesitter.lua b/nvim/lua/config/treesitter.lua index 9483653..df03ef2 100644 --- a/nvim/lua/config/treesitter.lua +++ b/nvim/lua/config/treesitter.lua | |||
| @@ -10,7 +10,7 @@ M.languages = { | |||
| 10 | -- "jinja", | 10 | -- "jinja", |
| 11 | -- "jinja_inline", | 11 | -- "jinja_inline", |
| 12 | "jq", | 12 | "jq", |
| 13 | "json", -- deckt auch den Dateityp jsonc ab (siehe lua/config/filetypes.lua) | 13 | "json", -- deckt auch den Dateityp jsonc ab (siehe extra_filetypes) |
| 14 | "lua", | 14 | "lua", |
| 15 | "make", | 15 | "make", |
| 16 | "markdown", | 16 | "markdown", |
