Skip to content

feat(nvim): delta location previews for Telescope#91

Merged
aguil merged 6 commits into
fix/tmux-session-picker-shortcutsfrom
feat/nvim-delta-location-previews
Jun 11, 2026
Merged

feat(nvim): delta location previews for Telescope#91
aguil merged 6 commits into
fix/tmux-session-picker-shortcutsfrom
feat/nvim-delta-location-previews

Conversation

@aguil

@aguil aguil commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

Stacked on #90. Adds delta-colored diff previews for LSP references and other location pickers, with scroll-to-line, diff-base toggle integration, and reference-row highlighting in busy diffs. Also fixes delta paging in branch diff previews, exports the gh route helper for agent subprocesses, and includes small dotfiles hygiene commits (Vale vocabulary, global gitignore).

Commits

  • fix(gh): export route helper for agent subprocesses — guard and export _chez_gh_route_config_dir so agent shells that rehydrate BASH_FUNC_* from export -p do not break per-directory gh routing.
  • fix(nvim): disable delta paging in branch diff preview — pass --paging=never so termopen previews show the full diff.
  • feat(nvim): add delta location previews and shared diff base — custom qflist/grep previewers, shared vcs.lua diff helpers, <leader>tJ base toggle, dynamic preview titles, insert-mode-friendly previews.
  • feat(nvim): highlight reference row in delta location previews — awk post-process paints the reference line with Telescope selection colors; per-line preview cache.
  • chore(vale): add github to Dotfiles accept list — allow lowercase "github" in Vale prose checks.
  • chore(gitignore): ignore Claude settings.local.json — global ignore for machine-local Claude Code settings.

Test plan

  • chezmoi apply and restart Neovim
  • grr on a symbol in a changed file: delta diff preview, title shows path:line, reference row highlighted, scroll centers on line
  • Filter/type in the picker without dropping out of insert mode; j/k scroll works
  • <leader>tJ toggles diff base; preview updates accordingly
  • <leader>gb branch picker: long diffs show fully (no pager stop)
  • gh in an agent subprocess shell: no _chez_gh_route_config_dir errors
  • .claude/settings.local.json under a repo is ignored when using global gitignore

aguil added 5 commits June 10, 2026 18:23
Agent shells (Claude Code, Cursor) rehydrate BASH_FUNC_gh from export -p
without private helpers, which printed "command not found:
_chez_gh_route_config_dir" on every gh invocation.

Guard the helper call when it is missing and export
_chez_gh_route_config_dir with gh in bash so per-directory routing
still works after rehydration. Mirror the guard in zsh with whence.

Verify: run gh in a Claude Code bash session; stderr stays clean and
auth routing matches the working directory.
Telescope branch-changes preview pipes diffs through delta via termopen.
The pseudo-TTY makes delta use its pager, so the preview stopped at the
first page instead of showing the full diff.

Pass --paging=never to delta so the entire highlighted diff lands in the
preview buffer and scrolls normally.

Verify: <leader>gb on a file with a long diff; preview shows all lines.
Wire custom Telescope qflist/grep previewers through delta for LSP
references and other location pickers, with scroll-to-line and file-at-line
fallback when the reference is outside diff hunks. Centralize git/jj diff
base toggle (<leader>tJ) and diff helpers in vcs.lua; reuse them for
branch-change and git preview pickers.

Enable dynamic_preview_title so preview borders show path:line. Avoid
CursorLine in terminal previews to keep the filter prompt in insert mode.

Verify: grr on changed files (scroll + title), branch picker diff preview,
and <leader>tJ toggling diff base.
Post-process delta output with awk to paint the LSP reference line using
TelescopePreviewLine/Visual bg (and fg when set), so busy diffs show a
selection-style row instead of inverse video. Cache preview buffers per
reference line so each selection gets its own highlighted render.

Verify: grr on a file with large diffs — reference row matches selected
line styling and scroll still centers on it.
Allow lowercase "github" in Vale prose checks for commit messages and
docs that reference the GitHub CLI or host.

Verify: vale on a doc containing "github" passes Dotfiles vocabulary.
@aguil aguil force-pushed the feat/nvim-delta-location-previews branch from cd79216 to fc2c551 Compare June 11, 2026 00:27
Add a global ignore for **/.claude/settings.local.json so machine-local
Claude Code settings are not tracked when projects symlink or copy dotfiles
gitignore rules.

Verify: create .claude/settings.local.json under a repo; git status stays clean
with core.excludesfile pointing at this global gitignore.
@aguil aguil merged commit e9eb641 into fix/tmux-session-picker-shortcuts Jun 11, 2026
1 check passed
@aguil aguil deleted the feat/nvim-delta-location-previews branch June 11, 2026 00:36
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