2023-08-02 16:39:49 +02:00
|
|
|
vim.filetype.add({extension = {wgsl = "wgsl"}})
|
|
|
|
|
|
|
|
require"nvim-treesitter.configs".setup {
|
2023-12-07 23:04:29 +01:00
|
|
|
ensure_installed = { "wgsl", "bash", "cmake", "cpp", "dockerfile", "gitignore", "glsl", "go", "graphql", "html", "java", "javascript", "json5", "kotlin", "markdown", "python", "rasi", "regex", "c", "lua", "rust", "scss", "sql", "sxhkdrc", "toml", "typescript", "yaml" },
|
2023-08-02 16:39:49 +02:00
|
|
|
sync_install = false,
|
|
|
|
auto_install = true,
|
|
|
|
indent = { enable = true, disable = { 'python' } },
|
|
|
|
highlight = {
|
2023-08-21 20:15:44 +02:00
|
|
|
enable = true,
|
2023-08-02 16:39:49 +02:00
|
|
|
},
|
|
|
|
incremental_selection = {
|
2023-08-21 20:15:44 +02:00
|
|
|
enable = true,
|
|
|
|
keymaps = {
|
|
|
|
init_selection = "gnn",
|
|
|
|
node_incremental = "grn",
|
|
|
|
scope_incremental = "grc",
|
|
|
|
node_decremental = "grm",
|
|
|
|
},
|
2023-08-02 16:39:49 +02:00
|
|
|
},
|
2023-12-07 23:04:29 +01:00
|
|
|
-- rainbow = {
|
|
|
|
-- enable = true,
|
|
|
|
-- -- list of languages you want to disable the plugin for
|
|
|
|
-- disable = {},
|
|
|
|
-- -- Which query to use for finding delimiters
|
|
|
|
-- query = 'rainbow-parens',
|
|
|
|
-- -- Highlight the entire buffer all at once
|
|
|
|
-- strategy = require('ts-rainbow').strategy.global,
|
|
|
|
-- },
|
2023-08-21 20:15:44 +02:00
|
|
|
}
|
2023-08-02 16:39:49 +02:00
|
|
|
|
2023-10-16 20:43:12 +02:00
|
|
|
local treesitter_parser_config = require "nvim-treesitter.parsers".get_parser_configs()
|
|
|
|
treesitter_parser_config.templ = {
|
|
|
|
install_info = {
|
|
|
|
url = "https://github.com/vrischmann/tree-sitter-templ.git",
|
|
|
|
files = {"src/parser.c", "src/scanner.c"},
|
|
|
|
branch = "master",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2023-12-07 23:04:29 +01:00
|
|
|
treesitter_parser_config.just = {
|
|
|
|
install_info = {
|
|
|
|
url = "https://github.com/IndianBoy42/tree-sitter-just", -- local path or git repo
|
|
|
|
files = { "src/parser.c", "src/scanner.cc" },
|
|
|
|
branch = "main",
|
|
|
|
-- use_makefile = true -- this may be necessary on MacOS (try if you see compiler errors)
|
|
|
|
},
|
|
|
|
maintainers = { "@IndianBoy42" },
|
|
|
|
}
|
|
|
|
|
2023-10-16 20:43:12 +02:00
|
|
|
vim.treesitter.language.register('templ', 'templ')
|
|
|
|
|
2023-09-19 18:57:21 +02:00
|
|
|
vim.wo.foldmethod = "manual"
|
2023-08-02 16:39:49 +02:00
|
|
|
vim.wo.foldexpr = "nvim_treesitter#foldexpr()"
|
|
|
|
vim.o.foldlevelstart = 99 -- do not close folds when a buffer is opened
|