added cpp, rust, go, php, ruby to the language list

This commit is contained in:
n 2024-10-27 07:48:17 +00:00
parent 12aa936655
commit 782f37021e

View File

@ -1,14 +1,11 @@
return { return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", config = function()
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup({
-- A list of parser names, or "all" -- A list of parser names, or "all"
ensure_installed = { ensure_installed = {
"vimdoc", "javascript", "typescript", "vue", "lua", "yaml", "vimdoc", "javascript", "typescript", "vue", "lua", "yaml",
"jsdoc", "bash", "powershell", "c_sharp", "json", "sql", "jsdoc", "bash", "powershell", "c_sharp", "json", "sql",
"vim", "html", "css", "scss", "jsonc", "python", "http", "vim", "html", "css", "scss", "jsonc", "python", "http",
"xml" "xml", "cpp", "rust", "go", "php", "ruby",
}, },
-- Install parsers synchronously (only applied to `ensure_installed`) -- Install parsers synchronously (only applied to `ensure_installed`)
@ -35,14 +32,10 @@ return {
}) })
local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs() local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs()
treesitter_parser_config.templ = { treesitter_parser_config.templ = { install_info = {
install_info = {
url = "https://github.com/vrischmann/tree-sitter-templ.git", url = "https://github.com/vrischmann/tree-sitter-templ.git",
files = {"src/parser.c", "src/scanner.c"}, files = {"src/parser.c", "src/scanner.c"}, branch = "master",
branch = "master", } }
},
}
vim.treesitter.language.register("templ", "templ") vim.treesitter.language.register("templ", "templ")
end end }
}