diff --git a/dot_config/nvim/exact_lua/exact_plugins/exact_editor/syntax.lua b/dot_config/nvim/exact_lua/exact_plugins/exact_editor/syntax.lua index 445380b..1fe4c53 100644 --- a/dot_config/nvim/exact_lua/exact_plugins/exact_editor/syntax.lua +++ b/dot_config/nvim/exact_lua/exact_plugins/exact_editor/syntax.lua @@ -1,14 +1,24 @@ return { { "nvim-treesitter/nvim-treesitter", + cond = function() + -- 檢查是否有 gcc 或 clang 或 cc(任一存在就啟用) + return vim.fn.executable("gcc") == 1 + or vim.fn.executable("cc") == 1 + or vim.fn.executable("clang") == 1 + or vim.fn.executable("cl") == 1 + or vim.fn.executable("zig") == 1 + end, build = ":TSUpdate", config = function() require("nvim-treesitter.configs").setup({ - ensure_installed = { "regex" }, -- 確保安裝 regex 支援 + ensure_installed = { "lua", "php", "python", "go", "html", "css", "javascript" }, + -- ensure_installed = { "regex" }, -- 確保安裝 regex 支援 highlight = { enable = true, -- 啟用高亮 }, + indent = { enable = true }, }) end, - } + }, }