Skip to content

Instantly share code, notes, and snippets.

@nolfonzo
Last active August 24, 2026 04:52
Show Gist options
  • Select an option

  • Save nolfonzo/569abdf7930637b82702e5c965f2da8b to your computer and use it in GitHub Desktop.

Select an option

Save nolfonzo/569abdf7930637b82702e5c965f2da8b to your computer and use it in GitHub Desktop.
Katana Neovim & LazyVim Treesitter glibc fix
#!/usr/bin/env bash
set -e
echo "=== 1. Ensuring build tools and C compiler are ready ==="
if command -v conda &>/dev/null || module load anaconda3 2>/dev/null; then
conda install -y -p "$HOME/.local/envs/nvim" -c conda-forge gcc_linux-64 gxx_linux-64 make tree-sitter-cli git 2>/dev/null || true
fi
if [ -f "$HOME/.local/bin/micromamba" ]; then
"$HOME/.local/bin/micromamba" install -y -p "$HOME/.local/envs/nvim" -c conda-forge gcc_linux-64 gxx_linux-64 make tree-sitter-cli git 2>/dev/null || true
fi
echo "=== 2. Writing clean Treesitter configuration ==="
mkdir -p "$HOME/.config/nvim/lua/plugins"
cat > "$HOME/.config/nvim/lua/plugins/treesitter.lua" << 'LUA'
return {
{
"nvim-treesitter/nvim-treesitter",
init = function()
require("nvim-treesitter.install").prefer_git = true
end,
opts = {
prefer_git = true,
auto_install = true,
ensure_installed = {
"bash",
"c",
"html",
"javascript",
"json",
"lua",
"luadoc",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"vim",
"vimdoc",
"yaml",
},
},
},
}
LUA
echo "=== 3. Cleaning broken parser caches ==="
rm -rf "$HOME/.local/share/nvim/site/parser"
rm -rf "$HOME/.local/share/nvim/lazy/nvim-treesitter/parser"
rm -rf "$HOME/.local/share/nvim/lazy/nvim-treesitter/parser-info"
echo "=== 4. Recompiling Treesitter parsers headlessly from source ==="
export PATH="$HOME/.local/envs/nvim/bin:$HOME/.local/bin:$PATH"
nvim --headless +"TSUpdateSync" +qa
echo ""
echo "=============================================="
echo " SUCCESS: Treesitter is now fully fixed! "
echo " Launch Neovim by typing: nvim "
echo "=============================================="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment