You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explicitly stop active LSPs & freeze terminal jobs (if enabled)
:LspResume
cmd
Reattach LSP across all open split buffers & unfreeze jobs
:LspToggle
cmd
Toggle suspend/resume state
Editor Options
2-space indentation default, expandtab (Python enforces 4 spaces via PEP 8)
Relative line numbers (automatically toggles to absolute in Insert mode)
Persistent undo (~/.local/state/nvim/undo)
No swap or backup files
Treesitter-based folding with fast manual folding during insert mode
wrap = true with linebreak, breakindent, and visual-line navigation (j/k)
Automatic theme hot-reloading via ~/.cache/nvim-live-theme and ~/.config/custom/current/
Markdown <mark> tag concealment with customizable highlight group
Tmux statusbar toggle (hides tmux status while nvim is active, restores on leave)
Stacking notifications one line above lualine (up to 3 concurrent; multi-line messages display at full height)
Cross-Platform Architecture & Agentic Coding Directives (Termux vs Desktop Linux)
This Neovim configuration is shared via Git across both Android (Termux) and Desktop Linux (Hyprland / Wayland / Foot).
Any automated agent or developer modifying this configuration must adhere to the following architectural invariants:
1. Platform Detection Standard
Always detect platform differences using strict boolean expressions:
localis_android= (vim.fn.has("android") ==1)
or (vim.env.PREFIX~=nilandvim.env.PREFIX:find("com%.termux") ~=nil)
Never rely on Lua truthiness hacks like A and B or C when B might be nil or false.
2. Environment Divergence & Tuning Invariants
Parameter / Behavior
Termux (Android Mobile)
Desktop Linux (Workstation)
Rationale
suspend_compilers
true
false
On desktop, freezing terminal buffers stops active background builds (cargo build), test runners, dev servers (vite), and drops SSH connections. On Termux, stopping CPU jobs prevents battery drain and OS-level task killing.
focus_lost_timeout
180000 (3 minutes)
1800000 (30 minutes)
Desktop tiling window managers (Hyprland) switch focus constantly. Killing LSPs after 3 minutes causes severe cold-start latency (rust-analyzer, clangd re-indexing).
idle_timeout
480000 (8 minutes)
3600000 (60 minutes)
Workstations have abundant RAM; mobile devices suffer from Android LowMemoryKiller (LMKD).
orphan_debounce
15000 (15 seconds)
60000 (60 seconds)
Closing a buffer to switch files should not immediately kill language servers on high-memory desktop environments.
3. Process Signaling & Procfs Rules
Process Group Fallback: When issuing signals via vim.uv.kill(pid, sig), always signal the process group (-pid) first, but must provide an immediate fallback to pid if group signaling fails.
VimLeavePre Cleanup: No process must ever be left in SIGSTOP (T state) on Neovim exit. All suspended jobs must be cleanly signaled with SIGCONT.
Procfs Direct Access: On Linux, read /proc/<pid>/task/<pid>/children directly for instantaneous child PID lookups. Fall back to pgrep -P only on Android/Termux where task children nodes may be restricted by the vendor kernel. Never run synchronous subshells (io.popen) in hot paths or event loops.
4. LSP & Buffer Handling
Multi-Split Awareness: When resuming LSPs, iterate over all valid windows (vim.api.nvim_list_wins()) and attach across visible buffers. Never assume vim.api.nvim_get_current_buf() is the only displayed buffer.
Orphan Client Filtering: A buffer attached to an LSP is valid if it is loaded AND either buflisted OR currently displayed in any window (vim.fn.bufwinid(bufnr) ~= -1). Do not terminate LSPs serving unlisted diff, fugitive, or preview buffers.
API Modernization: Use Neovim 0.12+ public APIs (e.g. vim.lsp.get_configs({ enabled = true, filetype = ft })) while retaining backward-compatible fallbacks for Neovim 0.10/0.11. Never bind directly to private tables (e.g. vim.lsp.config._configs) without public fallbacks.
5. Pathing, Binaries & Runtime Quirks
Binary Presence: Always check binary presence via vim.fn.executable(...) == 1 before invoking external CLI tools or daemons.
Path Portability: Never hardcode absolute system paths (e.g. /usr/bin vs $PREFIX/bin or /data/data/com.termux/files/usr/bin).
Shebangs (/usr/bin/env): Android rootfs lacks /usr/bin/env. Executables installed via npm or Mason that use #!/usr/bin/env <interp> fail with bad interpreter: No such file or directory. In Termux, run termux-fix-shebang on installed npm/mason package binaries or invoke them through their language runtime.
Temporary Directories (/tmp): The standard /tmp path does not exist on Android rootfs; attempts to access /tmp produce a read-only filesystem error. Always use vim.fn.tempname() or $TMPDIR (/data/data/com.termux/files/usr/tmp).
C Runtime (glibc vs Bionic): Mason packages containing pre-compiled glibc ELF binaries (e.g. marksman-linux-arm64) cannot execute on Android Bionic libc (cannot execute: required file not found). On Termux, prioritize native packages (pkg install), Node/npm packages, or Rust crates built on device.