Don't automatically compile all TS parsers on Android
This commit is contained in:
parent
96ea0be28c
commit
2f9633a715
2 changed files with 17 additions and 0 deletions
10
lua/core/termux.lua
Normal file
10
lua/core/termux.lua
Normal 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,
|
||||||
|
}
|
|
@ -9,6 +9,13 @@ return {
|
||||||
ensure_installed = "all",
|
ensure_installed = "all",
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
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)
|
require("nvim-treesitter.configs").setup(opts)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue