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,48 +1,41 @@
return { return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", config = function()
"nvim-treesitter/nvim-treesitter", require("nvim-treesitter.configs").setup({
build = ":TSUpdate", -- A list of parser names, or "all"
config = function() ensure_installed = {
require("nvim-treesitter.configs").setup({ "vimdoc", "javascript", "typescript", "vue", "lua", "yaml",
-- A list of parser names, or "all" "jsdoc", "bash", "powershell", "c_sharp", "json", "sql",
ensure_installed = { "vim", "html", "css", "scss", "jsonc", "python", "http",
"vimdoc", "javascript", "typescript", "vue", "lua", "yaml", "xml", "cpp", "rust", "go", "php", "ruby",
"jsdoc", "bash", "powershell", "c_sharp", "json", "sql", },
"vim", "html", "css", "scss", "jsonc", "python", "http",
"xml"
},
-- Install parsers synchronously (only applied to `ensure_installed`) -- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false, sync_install = false,
-- Automatically install missing parsers when entering buffer -- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don"t have `tree-sitter` CLI installed locally -- Recommendation: set to false if you don"t have `tree-sitter` CLI installed locally
auto_install = true, auto_install = true,
indent = { indent = {
enable = true enable = true
}, },
highlight = { highlight = {
-- `false` will disable the whole extension -- `false` will disable the whole extension
enable = true, enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on "syntax" being enabled (like for indentation). -- Set this to `true` if you depend on "syntax" being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights. -- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages -- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = { "markdown" }, additional_vim_regex_highlighting = { "markdown" },
}, },
}) })
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"}, branch = "master",
files = {"src/parser.c", "src/scanner.c"}, } }
branch = "master",
},
}
vim.treesitter.language.register("templ", "templ") vim.treesitter.language.register("templ", "templ")
end end }
}