A pre-configured, mobile-optimized AstroNvim v6+ configuration tailored specifically for Termux (Android) and Linux environments.
This setup uses native binary detection to bypass Mason glibc compatibility issues on Android, providing high-performance LSP servers, Treesitter parsers, None-LS formatters, and Live PDF Preview for LaTeX and Markdown files.
- Supported Languages & Tools
- System Requirements
- Step-by-Step Installation Guide
- π LaTeX & Markdown Live PDF Preview
- π€ Smali (Android Bytecode) LSP Environment
- β‘ Building blink.cmp Natively
- π± 32-Bit Termux (ARMv7 / i686) Guide
- π Verification & Diagnostics
| Language / Filetype | Language Server (LSP) | Formatter / Linter | Binary Source |
|---|---|---|---|
| Lua | lua_ls |
stylua |
Termux pkg |
| Bash / Shell | bashls |
shfmt |
npm / Termux pkg |
| C / C++ / ObjC | clangd / ccls |
clang-format |
Termux pkg |
| Rust | rust_analyzer |
cargo fmt |
Termux pkg / Cargo |
| LaTeX / TeX | texlab / digestif |
LSP / latexindent |
Termux pkg / LuaRocks |
| Markdown / Web | render-markdown |
prettier |
Termux pkg / npm / Lazy Spec |
| JSON / JQ | jq_lsp |
prettier |
Termux pkg / npm |
| Fish Shell | fish_lsp |
fish_indent |
npm / Termux pkg |
| Smali (Android Bytecode) | smali_lsp |
LSP Diagnostics | Built fat JAR (smali-lsp-1.5.0.jar) |
- Termux on Android (ARM64
aarch64or 32-bitarmv7l). - Neovim 0.10+ (AstroNvim v6+ compatible).
- C/C++ build toolchain (
clang,build-essential,make). - Rust toolchain (
cargo,rustc). typst&pandocfor PDF compilation and live preview.
Run the following command in Termux to install Neovim, compilers, development tools, PDF generators, and native LSP packages:
apt update && yes | apt upgrade
apt install -y \
git \
neovim \
build-essential \
clang \
ccls \
ripgrep \
fzf \
rust \
rust-analyzer \
lua-language-server \
luarocks \
nodejs-lts \
python \
jq \
fish \
shfmt \
stylua \
tree-sitter \
texinfo \
texlab \
tectonic \
typst \
pandocNote on
fish_indent& Fish Shell:
fish_indentcomes pre-packaged withfish. Installingpkg install fishautomatically placesfish_indentat/data/data/com.termux/files/usr/bin/fish_indent.none-lsautomatically detects it for formatting.fishfiles.
Install Node.js based LSPs/formatters, fish-lsp, and the Lua-based TeX LSP (digestif):
# Install bash language server, prettier, and fish-lsp globally via npm
npm install -g bash-language-server prettier @fish-lsp/fish-lsp
# Install digestif (LaTeX LSP) via LuaRocks
luarocks install digestifIf you are compiling C/C++ or Rust libraries that link directly against Android NDK native shared libraries (like liblog, libandroid, libvulkan), install NDK native stubs:
pkg install ndk-multilib ndk-multilib-native-stubsEnsure your shell (~/.bashrc, ~/.zshrc, or config.fish) includes ~/.cargo/bin and ~/.local/bin in your environment PATH.
Add the following to ~/.bashrc:
export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$HOME/bin:$PATH"Apply changes immediately:
source ~/.bashrcIf you have an existing Neovim configuration, back it up first:
mv ~/.config/nvim ~/.config/nvim.bak
mv ~/.local/share/nvim ~/.local/share/nvim.bak
mv ~/.local/state/nvim ~/.local/state/nvim.bak
mv ~/.cache/nvim ~/.cache/nvim.bakClone this repository into ~/.config/nvim:
git clone https://github.com/remo7777/Astronvim-Termux ~/.config/nvimStart Neovim for the first time. Plugins will automatically download and sync via lazy.nvim:
nvimThis setup includes a complete document editing suite with TeXLab LSP, VimTeX, and Knap Live PDF Preview supporting both LaTeX (.tex) and Markdown (.md) files.
- Typst Engine: Uses
typstas the PDF rendering engine for ultra-fast, high-quality compilation with full UTF-8 Unicode and Emoji support (π,π‘,ποΈ). - TeXLab LSP Tuning: Suppresses harmless
"Unused label"diagnostic hints while retaining error diagnostics. - VimTeX Integration: AstroCommunity VimTeX integration (
astrocommunity.markdown-and-latex.vimtex) for LaTeX syntax highlighting, TOC navigation (:VimtexTocOpen), and environment motions. - Android Native Viewer: Uses
termux-opento automatically open and refresh generated PDF files in your default Android PDF Viewer / Reader.
The <Leader>k group is buffer-local and appears in WhichKey when editing LaTeX (.tex, .plaintex) or Markdown (.md) files. On other files (.sh, .lua, .py, .c), <Leader>k remains hidden.
When editing a .tex or .md file, press <Space> (Leader key) to see:
k - σ°¦ Preview
βββ p - Toggle Live PDF Preview
βββ v - Jump to PDF Viewer
βββ c - Close PDF Viewer
<Leader>kp: Toggle Live Auto-Preview ON/OFF (Compiles on save and opens PDF viatermux-open)<Leader>kv: Refresh / Jump to PDF Viewer<Leader>kc: Close PDF Viewer
In Termux, Neovim exports LD_PRELOAD=/data/data/com.termux/files/usr/lib/libluajit.so. When Pandoc (which uses standard Lua 5.4) is spawned from inside Neovim (jobstart), force-preloaded LuaJIT symbols cause dynamic symbol conflicts resulting in PANIC: unprotected error in call to Lua API (exit code 1).
This configuration automatically prepends env LD_PRELOAD= to all Knap execution routines (knap.lua), ensuring clean, error-free PDF background rendering:
textopdf = "env LD_PRELOAD= pandoc %docroot% -o %outputfile% --pdf-engine=typst",
mdtopdf = "env LD_PRELOAD= pandoc %docroot% -o %outputfile% --pdf-engine=typst",This setup includes a native Smali Language Server (smali_lsp) and Tree-sitter Smali environment for Android bytecode reverse engineering.
- Smali LSP (
smali_lsp): Real-time syntax and semantic diagnostics (textDocument/publishDiagnostics), class/method document symbols, declaration lookups, and autocompletion. - Global Binary Launcher: Executable launcher at
~/.local/bin/smali-lsprunning the high-performance Kotlin/ANTLR shadow JAR (smali-lsp-1.5.0.jar). - Automatic Workspace Detection: Automatically attaches to project roots containing
.git,AndroidManifest.xml, orapktool.yml, with single-file fallback. - Tree-sitter Smali: Fast syntax highlighting and AST node parsing via
nvim-treesitter.
blink.cmp uses a C/Rust dynamic shared library (libblink_cmp_fuzzy.so) for ultra-fast fuzzy completion matching. Precompiled glibc binaries fail on Android/Termux, so it must be built natively using Cargo.
- Rust Compiler & Toolchain:
pkg install rust build-essential git
# 1. Navigate to the blink.cmp plugin directory in Lazy:
cd ~/.local/share/nvim/lazy/blink.cmp
# 2. Build the shared library using Cargo:
cargo build --release
# 3. Verify the generated shared library:
ls -lh target/release/libblink_cmp_fuzzy.soIn your Neovim plugin setup, force lazy.nvim to build the Rust library natively on update:
{
"Saghen/blink.cmp",
build = "cargo build --release",
opts = {
-- Your blink.cmp configuration options
},
}If you are running Termux on a 32-bit Android device (armv7l or i686), precompiled 64-bit binaries from Mason or GitHub releases will fail. Follow these solutions:
In lua/plugins/astrolsp.lua, ensure mason = false remains set. This forces AstroLSP to look for system binaries installed via pkg, luarocks, cargo, and npm.
Always use Termux's native package manager to fetch 32-bit compiled binaries:
pkg update && pkg upgrade -y
pkg install -y git neovim build-essential clang rust luarocks nodejs-lts python tree-sitter typst pandocIf a specific LSP package is missing in 32-bit main repos, install tur-repo:
pkg install tur-repo
pkg updateRunning cargo build --release inside plugin folders automatically detects 32-bit architecture (armv7-linux-androideabi) and compiles compatible .so dynamic libraries natively on your device.
Ensure clang and build-essential are installed so nvim-treesitter can compile 32-bit parser binaries (.so) on the fly when opening files for the first time.
Inside Neovim, verify that all plugins and LSPs are installed properly:
:checkhealth
:LspInfoTo test loaded AstroLSP server status from the command line:
nvim --headless +":lua print(vim.inspect(require('astrolsp').config.servers))" +q