summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua/user/treesitter.lua
blob: 4ba181bb711453d9029920c31e408840398a98d8 (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
--! tree-sitter configuration


local ts = require 'nvim-treesitter'
local tsc = require 'nvim-treesitter.configs'

local tsp = require 'nvim-treesitter.parsers'
local tsi = require 'nvim-treesitter.install'
 
vim.wo.foldmethod = 'expr'
vim.wo.foldexpr = 'nvim_treesitter#foldexpr()'
 
tsi.compilers = { 'clang' }

vim.filetype.add{
       pattern = {[".*/hypr/.*%.conf"] = "hyprlang"},
}

tsp.get_parser_configs().hyprland = {
       install_info = {
               url = "~/src/tree-sitter-hyprlang/",
               files = {"src/parser.c"},
               branch = "master",
               requires_generate_from_grammar = false, --ligma ballse
       },
       filetype = "hyprlang",
}


tsc.setup{
	ensure_installed = { "rust", "cpp", "python" },
	auto_install = true,
	highlight = {
		enable = true,
		additional_vim_regex_highlighting = true, ----------------------
	},
	ident = { enable = true },
	rainbow = {
		enable = true,
		extended_mode = true,
		max_file_lines = 1024,
	},
	fold = {
		enable = true,
	}
}