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
52
53
54
55
56
57
58
59
60
61
|
require('nvim-treesitter.configs').setup {
ensure_installed = { "typescript", "cpp", "javascript", "lua", "ocaml", "go", "dockerfile", "php", "perl", "json", "yaml", "toml", "html", "css", "bash", "tsx", "python", "rust", "haskell" },
sync_install = false,
auto_install = true,
indent = {
enable = false,
},
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
}
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.crystal = {
install_info = {
url = "https://github.com/crystal-lang-tools/tree-sitter-crystal",
files = { "src/parser.c", "src/scanner.c" },
branch = "main",
},
filetype = "crystal",
}
local list = require("nvim-treesitter.parsers").get_parser_configs()
list.reason = {
install_info = {
url = "https://github.com/reasonml-editor/tree-sitter-reason",
files = { "src/parser.c", "src/scanner.c" },
branch = "master",
},
}
vim.filetype.add {
extension = {
re = "reason",
},
}
vim.treesitter.language.add("reason", { filetype = "reason" })
require('treesitter-context').setup {
enable = false
}
local parser_config2 = require "nvim-treesitter.parsers".get_parser_configs()
parser_config2.haxe = {
install_info = {
url = "https://github.com/vantreeseba/tree-sitter-haxe",
files = { "src/parser.c", "src/scanner.c" },
-- optional entries:
branch = "main",
},
filetype = "haxe",
}
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
vim.opt.foldcolumn = "0"
vim.opt.foldtext = ""
vim.opt.foldlevel = 99
vim.opt.foldnestmax = 4
|