Neovim (Lua) authoring: Packer.nvim, Markdown preview, and TeX Live
January 14, 2025Neovim is my primary modal editor for technical writing and lightweight IDE-style tasks. Configuration is expressed in Lua and versioned in this repository. The setup is intentionally incremental: curated plugins, predictable keymaps, and a reproducible local toolchain rather than a monolithic distribution.
Plugin management uses Packer.nvim today; I am evaluating Lazy.nvim for faster startup and declarative spec loading (see below). For Markdown, Alt+k triggers markdown-preview.nvim in an existing browser session—equivalent to :MarkdownPreview—via Packer declarations such as:
-- install without yarn or npm
use({
"iamcco/markdown-preview.nvim",
run = function() vim.fn["mkdp#util#install"]() end,
})
use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, })
Other plugins follow the same use({ ... }) pattern. Full IDE-in-terminal stacks such as LunarVim exist; this config stays narrower and easier to reason about for documentation and LaTeX-heavy notes.
Neovim, LuaSnip, and a local LaTeX toolchain
For mathematical typesetting, local Neovim plus snippets (e.g., LuaSnip) competes well with hosted editors like Overleaf; see this migration-oriented guide for UltiSnips-to-LuaSnip patterns.
TeX Live on Ubuntu follows the upstream quick-install path: https://www.tug.org/texlive/quickinstall.html. The short version:
-
cdto a directory for the installer artifacts. -
Download:
wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz -
Or with curl:
curl -L -o install-tl-unx.tar.gz https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz -
Extract and run the non-interactive installer:
zcat < install-tl-unx.tar.gz | tar xf -
cd install-tl-*
sudo perl ./install-tl --no-interaction
Missing prerequisites
If curl or perl is absent, verify with:
curl --version
perl --version
On Ubuntu, refresh package indexes and install missing pieces:
sudo apt update && sudo apt upgrade
sudo apt install perl
sudo apt install curl
PATH and the TeX Live binary directory
Install logs typically instruct you to append TeX Live’s bin directory to PATH. Example (adjust year/architecture to match your install):
/usr/local/texlive/2023/bin/x86_64-linux
In ~/.bashrc:
# add to PATH texlive
export PATH="/usr/local/texlive/2023/bin/x86_64-linux:$PATH"
After editing shell startup files, source ~/.bashrc in the current session or open a new terminal. Confirm with:
echo "$PATH"
Migrating from Packer.nvim to Lazy.nvim
Lazy’s official migration guide documents how to translate packer.lua into Lazy’s plugin spec. Renaming packer.lua → lazy.lua mostly worked here; LaTeX snippet integration and .tex syntax highlighting still need tuning—an active follow-up as the spec stabilizes.
Overall, the stack demonstrates Lua-driven editor configuration, Node-assisted Markdown tooling where appropriate, and Linux system integration (package manager, PATH, long-running compiler installs)—the same class of environment hygiene that shows up when provisioning build agents or developer laptops for backend teams.