From 0df63002f8fc7530bec8e756e62d0fcb83e9914e Mon Sep 17 00:00:00 2001 From: aguil Date: Thu, 25 Jun 2026 22:11:28 -0600 Subject: [PATCH 1/5] feat(termux): add Nerd Font bootstrap Co-authored-by: Cursor --- .chezmoiexternal.toml.tmpl | 7 +++++++ .../run_after_30-termux-reload-settings.sh.tmpl | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 .chezmoiexternal.toml.tmpl create mode 100644 .chezmoiscripts/run_after_30-termux-reload-settings.sh.tmpl diff --git a/.chezmoiexternal.toml.tmpl b/.chezmoiexternal.toml.tmpl new file mode 100644 index 0000000..e38612f --- /dev/null +++ b/.chezmoiexternal.toml.tmpl @@ -0,0 +1,7 @@ +{{- $isTermux := or (hasPrefix "/data/data/com.termux/" .chezmoi.homeDir) (hasPrefix "/data/data/com.termux/" (env "PREFIX")) -}} +{{- if $isTermux }} +[".termux/font.ttf"] +type = "file" +url = "https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Meslo/M/Regular/MesloLGMNerdFontMono-Regular.ttf" +refreshPeriod = "168h" +{{- end }} diff --git a/.chezmoiscripts/run_after_30-termux-reload-settings.sh.tmpl b/.chezmoiscripts/run_after_30-termux-reload-settings.sh.tmpl new file mode 100644 index 0000000..5f48041 --- /dev/null +++ b/.chezmoiscripts/run_after_30-termux-reload-settings.sh.tmpl @@ -0,0 +1,9 @@ +{{- $isTermux := or (hasPrefix "/data/data/com.termux/" .chezmoi.homeDir) (hasPrefix "/data/data/com.termux/" (env "PREFIX")) -}} +{{- if $isTermux }} +#!/usr/bin/env sh +set -eu + +if command -v termux-reload-settings >/dev/null 2>&1; then + termux-reload-settings +fi +{{- end }} From 8062cc84a45757ce852b8018384d2d7c763bdae7 Mon Sep 17 00:00:00 2001 From: aguil Date: Thu, 25 Jun 2026 22:27:53 -0600 Subject: [PATCH 2/5] fix(termux): make reload hook executable Co-authored-by: Cursor --- .chezmoiscripts/run_after_30-termux-reload-settings.sh.tmpl | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .chezmoiscripts/run_after_30-termux-reload-settings.sh.tmpl diff --git a/.chezmoiscripts/run_after_30-termux-reload-settings.sh.tmpl b/.chezmoiscripts/run_after_30-termux-reload-settings.sh.tmpl old mode 100644 new mode 100755 From 52cf7fb92c72c02a17c26abda042052d4d98e814 Mon Sep 17 00:00:00 2001 From: aguil Date: Thu, 25 Jun 2026 22:34:24 -0600 Subject: [PATCH 3/5] fix(nvim): trim mobile startup tooling Co-authored-by: Cursor --- dot_config/nvim/init.lua | 64 ++++++++++++++++--- .../nvim/lua/custom/plugins/ai_assistant.lua | 1 + dot_config/nvim/lua/custom/plugins/ai_cli.lua | 1 + .../nvim/lua/custom/plugins/markdown.lua | 3 +- .../nvim/lua/custom/plugins/typescript.lua | 4 ++ dot_config/nvim/lua/custom/plugins/vale.lua | 1 + .../lua/custom/plugins/web_service_dev.lua | 2 + 7 files changed, 65 insertions(+), 11 deletions(-) diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index 04a6d0e..59a7a21 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -92,6 +92,12 @@ vim.g.maplocalleader = ' ' local path_sep = vim.fn.has 'win32' == 1 and ';' or ':' +local function path_starts_with(path, prefix) return type(path) == 'string' and path ~= '' and path:sub(1, #prefix) == prefix end + +local is_termux = path_starts_with(vim.env.PREFIX, '/data/data/com.termux/') or path_starts_with(vim.fn.expand '~', '/data/data/com.termux/') +vim.g.dot_is_termux = is_termux +vim.g.dot_mobile_nvim = is_termux or vim.env.DOT_MOBILE_NVIM == '1' + local function prepend_path(dir) if vim.fn.isdirectory(dir) == 1 and not string.find(vim.env.PATH or '', dir, 1, true) then vim.env.PATH = dir .. path_sep .. (vim.env.PATH or '') end end @@ -118,7 +124,7 @@ if vim.fn.has 'win32' == 1 then prepend_path(dir) end end -else +elseif not vim.g.dot_mobile_nvim then -- GUI/IDE launches often skip shell profile hooks; mise shims expose global tools (e.g. vale). prepend_path(vim.fn.expand '~/.local/share/mise/shims') end @@ -148,6 +154,20 @@ vim.o.showmode = false -- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` +if vim.g.dot_is_termux and vim.fn.executable 'termux-clipboard-set' == 1 and vim.fn.executable 'termux-clipboard-get' == 1 then + vim.g.clipboard = { + name = 'termux-clipboard', + copy = { + ['+'] = 'termux-clipboard-set', + ['*'] = 'termux-clipboard-set', + }, + paste = { + ['+'] = 'termux-clipboard-get', + ['*'] = 'termux-clipboard-get', + }, + cache_enabled = 0, + } +end vim.schedule(function() vim.o.clipboard = 'unnamedplus' end) -- Enable break indent @@ -176,7 +196,7 @@ vim.opt.fillchars:append { vert = '┃' } -- Per-character highlights inside changed diff lines (vimdiff, Gitsigns diffthis, Diffview, etc.) -- See :help 'diffopt' -if not vim.o.diffopt:find('inline:', 1, true) then vim.opt.diffopt:append 'inline:char' end +if vim.fn.has 'nvim-0.12' == 1 and not vim.o.diffopt:find('inline:', 1, true) then vim.opt.diffopt:append 'inline:char' end -- Sets how neovim will display certain whitespace characters in the editor. -- See `:help 'list'` @@ -212,7 +232,7 @@ vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic Config & Keymaps -- See :help vim.diagnostic.Opts -vim.diagnostic.config { +local diagnostic_config = { update_in_insert = false, severity_sort = true, float = { border = 'rounded', source = 'if_many' }, @@ -220,12 +240,15 @@ vim.diagnostic.config { -- Can switch between these as you prefer virtual_text = true, -- Text shows up at the end of the line - virtual_lines = false, -- Teest shows up underneath the line, with virtual lines - - -- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d` - jump = { float = true }, } +if vim.fn.has 'nvim-0.11' == 1 then + diagnostic_config.virtual_lines = false -- Text shows up underneath the line, with virtual lines + diagnostic_config.jump = { float = true } -- Auto-open diagnostic float when jumping with `[d` and `]d` +end + +vim.diagnostic.config(diagnostic_config) + vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier @@ -259,7 +282,10 @@ vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' } vim.api.nvim_create_autocmd('TextYankPost', { desc = 'Highlight when yanking (copying) text', group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), - callback = function() vim.hl.on_yank() end, + callback = function() + local highlight = vim.hl or vim.highlight + if highlight and highlight.on_yank then highlight.on_yank() end + end, }) -- [[ Install `lazy.nvim` plugin manager ]] @@ -1021,6 +1047,7 @@ require('lazy').setup({ { -- Main LSP Configuration 'neovim/nvim-lspconfig', + enabled = not vim.g.dot_mobile_nvim, dependencies = { -- Automatically install LSPs and related tools to stdpath for Neovim -- Mason must be loaded before its dependents so we need to set it up here. @@ -1506,6 +1533,7 @@ require('lazy').setup({ { 'nvim-neotest/neotest', + enabled = not vim.g.dot_mobile_nvim, dependencies = { 'nvim-neotest/nvim-nio', 'nvim-lua/plenary.nvim', @@ -1593,7 +1621,7 @@ require('lazy').setup({ -- Build Step is needed for regex support in snippets. -- This step is not supported in many windows environments. -- Remove the below condition to re-enable on windows. - if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then return end + if vim.fn.has 'win32' == 1 or vim.g.dot_mobile_nvim or vim.fn.executable 'make' == 0 then return end return 'make install_jsregexp' end)(), dependencies = { @@ -1675,6 +1703,7 @@ require('lazy').setup({ { 'juxt/nvim-allium', + enabled = not vim.g.dot_mobile_nvim, event = 'VeryLazy', opts = {}, dependencies = { @@ -1784,6 +1813,21 @@ require('lazy').setup({ 'vimdoc', 'yaml', } + if vim.g.dot_mobile_nvim then + parsers = { + 'bash', + 'diff', + 'json', + 'lua', + 'markdown', + 'markdown_inline', + 'query', + 'toml', + 'vim', + 'vimdoc', + 'yaml', + } + end local filetypes = vim.list_extend(vim.deepcopy(parsers), { 'javascriptreact', 'typescriptreact' }) local function chezmoi_template_language(bufnr) @@ -1829,7 +1873,7 @@ require('lazy').setup({ {} ) - if vim.fn.executable 'tree-sitter' == 1 then require('nvim-treesitter').install(parsers) end + if not vim.g.dot_mobile_nvim and vim.fn.executable 'tree-sitter' == 1 then require('nvim-treesitter').install(parsers) end vim.api.nvim_create_autocmd('FileType', { pattern = filetypes, callback = function() pcall(vim.treesitter.start) end, diff --git a/dot_config/nvim/lua/custom/plugins/ai_assistant.lua b/dot_config/nvim/lua/custom/plugins/ai_assistant.lua index 6a40311..d3591f6 100644 --- a/dot_config/nvim/lua/custom/plugins/ai_assistant.lua +++ b/dot_config/nvim/lua/custom/plugins/ai_assistant.lua @@ -1,6 +1,7 @@ return { { 'olimorris/codecompanion.nvim', + enabled = not vim.g.dot_mobile_nvim, cmd = { 'CodeCompanion', 'CodeCompanionActions', 'CodeCompanionChat' }, dependencies = { 'nvim-lua/plenary.nvim', diff --git a/dot_config/nvim/lua/custom/plugins/ai_cli.lua b/dot_config/nvim/lua/custom/plugins/ai_cli.lua index 5fd1a58..1b03cb1 100644 --- a/dot_config/nvim/lua/custom/plugins/ai_cli.lua +++ b/dot_config/nvim/lua/custom/plugins/ai_cli.lua @@ -1,6 +1,7 @@ return { { 'akinsho/toggleterm.nvim', + enabled = not vim.g.dot_mobile_nvim, version = '*', opts = { direction = 'float', diff --git a/dot_config/nvim/lua/custom/plugins/markdown.lua b/dot_config/nvim/lua/custom/plugins/markdown.lua index 2bb8265..33e001c 100644 --- a/dot_config/nvim/lua/custom/plugins/markdown.lua +++ b/dot_config/nvim/lua/custom/plugins/markdown.lua @@ -98,6 +98,7 @@ return { { 'iamcco/markdown-preview.nvim', + enabled = not vim.g.dot_mobile_nvim, cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' }, ft = { 'markdown' }, build = 'cd app && npm install', @@ -129,7 +130,7 @@ return { { '3rd/image.nvim', - cond = terminal_graphics_supported, + cond = function() return not vim.g.dot_mobile_nvim and terminal_graphics_supported() end, event = 'VeryLazy', build = false, opts = { diff --git a/dot_config/nvim/lua/custom/plugins/typescript.lua b/dot_config/nvim/lua/custom/plugins/typescript.lua index f0d5bcf..cb8ef17 100644 --- a/dot_config/nvim/lua/custom/plugins/typescript.lua +++ b/dot_config/nvim/lua/custom/plugins/typescript.lua @@ -1,6 +1,7 @@ return { { 'pmizio/typescript-tools.nvim', + enabled = not vim.g.dot_mobile_nvim, dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig', @@ -63,6 +64,7 @@ return { { 'mfussenegger/nvim-lint', + enabled = not vim.g.dot_mobile_nvim, event = { 'BufReadPre', 'BufNewFile' }, config = function() local lint = require 'lint' @@ -123,12 +125,14 @@ return { { 'dmmulroy/ts-error-translator.nvim', + enabled = not vim.g.dot_mobile_nvim, ft = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' }, opts = {}, }, { 'windwp/nvim-ts-autotag', + enabled = not vim.g.dot_mobile_nvim, ft = { 'javascriptreact', 'typescriptreact', 'html' }, opts = {}, }, diff --git a/dot_config/nvim/lua/custom/plugins/vale.lua b/dot_config/nvim/lua/custom/plugins/vale.lua index c9335a3..dc13bc5 100644 --- a/dot_config/nvim/lua/custom/plugins/vale.lua +++ b/dot_config/nvim/lua/custom/plugins/vale.lua @@ -80,6 +80,7 @@ return { }, { 'mfussenegger/nvim-lint', + enabled = not vim.g.dot_mobile_nvim, keys = { { ',a', diff --git a/dot_config/nvim/lua/custom/plugins/web_service_dev.lua b/dot_config/nvim/lua/custom/plugins/web_service_dev.lua index 3d9431b..6c468d5 100644 --- a/dot_config/nvim/lua/custom/plugins/web_service_dev.lua +++ b/dot_config/nvim/lua/custom/plugins/web_service_dev.lua @@ -1,6 +1,7 @@ return { { 'folke/which-key.nvim', + enabled = not vim.g.dot_mobile_nvim, optional = true, opts = function(_, opts) opts.spec = opts.spec or {} @@ -10,6 +11,7 @@ return { }, { 'nvim-lua/plenary.nvim', + enabled = not vim.g.dot_mobile_nvim, lazy = false, config = function() local uv = vim.uv or vim.loop From 3f80791c9db2a8fa94bddfda6f661d19b825295b Mon Sep 17 00:00:00 2001 From: aguil Date: Thu, 25 Jun 2026 22:36:33 -0600 Subject: [PATCH 4/5] fix(termux): avoid reload hook on apply Co-authored-by: Cursor --- .../run_after_30-termux-reload-settings.sh.tmpl | 9 --------- 1 file changed, 9 deletions(-) delete mode 100755 .chezmoiscripts/run_after_30-termux-reload-settings.sh.tmpl diff --git a/.chezmoiscripts/run_after_30-termux-reload-settings.sh.tmpl b/.chezmoiscripts/run_after_30-termux-reload-settings.sh.tmpl deleted file mode 100755 index 5f48041..0000000 --- a/.chezmoiscripts/run_after_30-termux-reload-settings.sh.tmpl +++ /dev/null @@ -1,9 +0,0 @@ -{{- $isTermux := or (hasPrefix "/data/data/com.termux/" .chezmoi.homeDir) (hasPrefix "/data/data/com.termux/" (env "PREFIX")) -}} -{{- if $isTermux }} -#!/usr/bin/env sh -set -eu - -if command -v termux-reload-settings >/dev/null 2>&1; then - termux-reload-settings -fi -{{- end }} From 7bef9a4bdfab9f1099bf51847f1c3855278069c9 Mon Sep 17 00:00:00 2001 From: aguil Date: Thu, 25 Jun 2026 22:40:01 -0600 Subject: [PATCH 5/5] fix(nvim): keep plenary available on mobile Co-authored-by: Cursor --- dot_config/nvim/lua/custom/plugins/web_service_dev.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dot_config/nvim/lua/custom/plugins/web_service_dev.lua b/dot_config/nvim/lua/custom/plugins/web_service_dev.lua index 6c468d5..e96e5d0 100644 --- a/dot_config/nvim/lua/custom/plugins/web_service_dev.lua +++ b/dot_config/nvim/lua/custom/plugins/web_service_dev.lua @@ -11,9 +11,10 @@ return { }, { 'nvim-lua/plenary.nvim', - enabled = not vim.g.dot_mobile_nvim, lazy = false, config = function() + if vim.g.dot_mobile_nvim then return end + local uv = vim.uv or vim.loop local function detect_project_root()