From 1fd1dc8ac17d8cc2e8470a9dfc618791d4af6dcd Mon Sep 17 00:00:00 2001
From: PowerUser64 <blakelysnorth@gmail.com>
Date: Wed, 24 Aug 2022 04:11:50 -0700
Subject: [PATCH] nvim: lower packer's max_jobs to 5 in termux

---
 .config/nvim/lua/blake/plugins.lua | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua
index 192f5bc..cff5c2b 100644
--- a/.config/nvim/lua/blake/plugins.lua
+++ b/.config/nvim/lua/blake/plugins.lua
@@ -8,6 +8,13 @@ if fn.empty(fn.glob(install_path)) > 0 then
 end
 -- }}
 
+-- Reduce the maximum number of jobs in termux (a terminal for android)
+if os.getenv("TERMUX_VERSION") ~= nil then
+   Packer_max_jobs = 5
+else
+   Packer_max_jobs = 100
+end
+
 local use = require('packer').use
 
 return require('packer').startup({function()
@@ -580,7 +587,7 @@ config = {
    -- Don't ask before removing plugins
    autoremove = true,
    -- Limit max jobs to avoid getting killed on low-end hardware
-   max_jobs = 50,
+   max_jobs = Packer_max_jobs,
 }})
 
 -- how to align all plugin descriptions: select all plugins in visual line, :'<,'>Align \(.\+use { -- .\+: \+\)\@<=[^ ][^:]\+$