Don't automatically compile all TS parsers on Android

This commit is contained in:
Ryan El Kochta 2025-02-28 14:52:35 -05:00
parent 96ea0be28c
commit 2f9633a715
2 changed files with 17 additions and 0 deletions

10
lua/core/termux.lua Normal file
View file

@ -0,0 +1,10 @@
return {
is_termux = function()
if (vim.fn.getenv("TERMUX_VERSION") ~= "" and
vim.fn.isdirectory("/data/data/com.termux/files/usr") == 1) then
return true
end
return false
end,
}

View file

@ -9,6 +9,13 @@ return {
ensure_installed = "all",
},
config = function(_, opts)
-- Don't compile all parsers on Android
local termux = require("core.termux")
if termux.is_termux() then
opts.ensure_installed = { "c", "rust", "lua" }
opts.auto_install = true
end
require("nvim-treesitter.configs").setup(opts)
end,
}