Skip to content

feat: modernize Neovim setup, pin treesitter, add check script, and improve install process#3

Open
aggiebill wants to merge 6 commits into
masterfrom
feature/upgrade-neovim-treesitter-and-add-check-script
Open

feat: modernize Neovim setup, pin treesitter, add check script, and improve install process#3
aggiebill wants to merge 6 commits into
masterfrom
feature/upgrade-neovim-treesitter-and-add-check-script

Conversation

@aggiebill

Copy link
Copy Markdown
Owner

This PR brings the dotfiles repo up to the fully modernized state achieved in our session:

  • Latest Neovim (v0.12+) installed via official GitHub tarball to ~/.local (bypassing outdated Ubuntu 26.04 apt package)
  • nvim-treesitter pinned to v0.9.3 (compatible with current Neovim) with full classic configs.setup in nvim/lua/treesitter.lua (ensure_installed for python/bash + many supporting languages, highlight, indent, incremental_selection)
  • tree-sitter CLI binary installed
  • New ./check.sh script for comprehensive feature-by-feature verification of the entire dotfiles setup (symlinks, Neovim, treesitter, uv/ruff, fastfetch/MOTD, PATH, GPG, vim submodules, etc.)
  • install.sh fully updated to automate Neovim tarball, pinned plugin checkout, CLI install, symlinks, uv/ruff, MOTD, and submodules
  • bash_aliases: PATH now prepends ~/.local/bin for proper override of system tools
  • Documentation refreshed in README.md and nvim/init.vim with exact commands, pin steps, and troubleshooting
  • Various fixes for reproducibility (rtp append, legacy cleanup, etc.)

After ./install.sh (or manual equivalent), start Neovim once to let ensure_installed fetch parsers, then use ./check.sh to verify the state. This delivers a clean, up-to-date Neovim + Tree-sitter Python/shell experience with gnn/grn selection, superior highlighting/indent, etc.

Ready for review and merge. All changes tested on the target machine.

Only show the 'edit your gitconfig' message for fresh installs
where the name field is still empty/placeholder. Users who keep
personalized values directly in their local dotfiles repo copy
(no longer get the noisy reminder on every run or after updates).
The closing 'EOF' (and opening 'lua << EOF') were indented.
In Vim heredocs, the terminator must start at column 0 with no
leading whitespace, otherwise the block never ends and subsequent
Vimscript (the final 'endif') leaks into the Lua chunk.

This caused:
  E5107: Error loading lua ... '=' expected near 'endif'
  E171: Missing :endif

on Neovim startup.

Also verified: the block is defensive (pcall + has('nvim-0.9')),
so it is a no-op unless the user manually installs nvim-treesitter.
- Extract the treesitter setup to nvim/lua/treesitter.lua
- Load it with a protected 'lua pcall(require, "treesitter")'
- This completely removes the inline 'lua << EOF ... EOF' heredoc
  (and the confusing EOF marker line) from init.vim.
- Update install.sh to symlink the lua/ directory so requires work.
- Much cleaner, follows the 'put Lua files under lua/' guidance
  already present in the comments, and avoids Vim heredoc gotchas.

The optional treesitter block now works without any EOF line at all.
…perience

Added common supporting languages (json, yaml, toml, dockerfile, make,
regex, comment) in addition to python + bash.

This gives better highlighting/indent/incremental selection across
more file types the user is likely to edit daily, while keeping the
focus on Python and shell.
…larify :TSInstall usage

- The cloned nvim-treesitter (main branch) uses a slimmer API:
  - No more 'nvim-treesitter.configs' (it's now 'nvim-treesitter.config')
  - No old-style modules for highlight/indent/incremental_selection
  - :TSInstall requires arguments (nargs='+') — bare command errors with E471

- Updated our treesitter.lua:
  - Auto-triggers missing parsers via the install module (replaces ensure_installed)
  - Uses vim.treesitter.start() for highlighting on python/bash/etc. filetypes
  - Wires up nvim_treesitter#indent() for superior indentation
  - Uses Neovim's builtin treesitter foldexpr
  - Documents the lack of built-in incremental_selection in this version

- Clarified docs in init.vim so users don't hit the 'argument expected' surprise.

This should now deliver the great Python + shell treesitter experience
(highlighting + indent) with the parser manager we have installed.
…mprove install process

- Upgrade Neovim installation to use latest official tarball (v0.12+) instead of outdated apt package in Ubuntu 26.04
- Pin nvim-treesitter to v0.9.3 for compatibility with Neovim 0.11/0.12 and update treesitter.lua to use classic nvim-treesitter.configs.setup with ensure_installed for python, bash + supporting languages
- Add comprehensive check.sh script for feature-by-feature status verification of the entire dotfiles setup
- Update install.sh to fully automate: latest Neovim tarball, pinned treesitter plugin checkout, tree-sitter CLI binary, PATH setup, and parser auto-install on first nvim run
- Prepend ~/.local/bin to PATH in bash_aliases (instead of append) so local Neovim, uv, ruff, tree-sitter CLI take precedence
- Improve and expand documentation in README.md and nvim/init.vim with precise install/pin/CLI steps and troubleshooting notes
- Add runtimepath append in treesitter.lua to fix 'install directory not in runtimepath' health warning
- Clean up legacy neofetch references, update MOTD, ensure submodules and symlinks are handled
- Add tree-sitter CLI installation step for full :TSInstall / health support

These changes deliver a reproducible, modern Neovim + Tree-sitter experience (highlighting, indent, incremental selection for Python/shell) with automated verification via ./check.sh. All features now match the state achieved during the session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant