fix nvim: nvim-treesitter

This commit is contained in:
Yuan Chiu 2025-05-05 22:03:53 +08:00
parent bba73ba72c
commit f451e0e0fa
2 changed files with 21 additions and 2 deletions

View File

@ -22,3 +22,14 @@ vim.opt.colorcolumn = "80,120" -- 顯示編輯器建議寬度
vim.opt.scrolloff = 3 -- 捲動時保留 n 行彈性
require("config.listchars") -- 顯示行尾符號
vim.opt.list = true
-- 設定正確的檔案類型對應
vim.filetype.add({
pattern = {
[".+%.sh%.tmpl"] = "bash",
[".+%.zsh%.tmpl"] = "zsh",
[".+%.ps1%.tmpl"] = "powershell",
[".+%.py%.tmpl"] = "python",
[".+%.go%.tmpl"] = "go",
},
})

View File

@ -12,8 +12,16 @@ return {
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = { "lua", "php", "python", "go", "html", "css", "javascript" },
-- ensure_installed = { "regex" }, -- 確保安裝 regex 支援
ensure_installed = {
"regex",
"lua",
"php",
"python",
"go",
"html",
"css",
"javascript"
},
highlight = {
enable = true, -- 啟用高亮
},