aboutsummaryrefslogtreecommitdiff
path: root/nvim/lua/config/treesitter.lua
blob: f7ec87ea56484747e9fc1f3c321156e97b409d6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
local M = {}

-- https://github.com/nvim-treesitter/nvim-treesitter/blob/main/SUPPORTED_LANGUAGES.md
M.languages = {
  "bash",
  "c",
  "cpp",
  "html",
  "javascript",
  -- "jinja",
  -- "jinja_inline",
  "jq",
  "json", -- deckt auch den Dateityp jsonc ab (siehe lua/config/filetypes.lua)
  "lua",
  "make",
  "markdown",
  "markdown_inline",
  "po",
  "powershell",
  "prisma",
  "python",
  "typescript",
  "vim",
  "vimdoc",
  "xml",
  "yaml",
  "zsh",
}

-- Filetypes ohne gleichnamigen Parser, die Treesitter trotzdem nutzen sollen
-- (siehe config.filetypes: jsonc laeuft ueber den json-Parser).
M.extra_filetypes = {
  "jsonc",
}

-- Filetypes, fuer die Treesitter-Features aktiviert werden.
function M.filetypes()
  local filetypes = {}

  for _, language in ipairs(M.languages) do
    table.insert(filetypes, language)
  end

  for _, filetype in ipairs(M.extra_filetypes) do
    table.insert(filetypes, filetype)
  end

  return filetypes
end

return M