Skip to content

polyphilz/glance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Animated glance hero

A standalone Git diff review TUI powered by Neovim.

Launch a clean review UI for staged, unstaged, and untracked files without touching your existing Neovim setup.

CI macOS Linux Neovim 0.11+ Lua License: MIT


Animated demo of Glance reviewing git changes

Features

  • Standalone launcher that opens Glance in nvim --clean, so it does not depend on your plugin manager or existing editor config.
  • Side-by-side diffs with a minimap and live file reloads.
  • Unified file tree workflow:
    • single file tree for staged, unstaged, untracked, and conflicted files
    • stage, unstage, or discard one file or the whole repo
    • staged-change commit flow with a multi-line floating commit editor
    • read-only commit history browser launched from the file tree, with commit preview and hash copy
  • Lua config for theme, layout, keymaps, signs, refresh behavior, and more.

Quick Start

  1. Make sure these runtime dependencies are on your PATH:

    • nvim 0.11+
    • git
  2. Install Glance:

    Homebrew (macOS / Linux):

    brew install polyphilz/tap/glance

    Shell installer:

    curl -fsSL https://raw.githubusercontent.com/polyphilz/glance/main/install.sh | bash
  3. Optional: create a starter config file:

    glance init-config

    This writes a starter config to ~/.config/glance/config.lua by default. If GLANCE_CONFIG is set, Glance writes there instead.

  4. Run it inside any Git repository:

    cd /path/to/repo
    glance

Requirements

Dependency Required for Notes
macOS or Linux Running Glance The launcher and installer assume a Unix-like shell environment.
nvim 0.11+ Runtime UI Must be available on PATH as nvim.
git Repo detection, diffing, stage/unstage/discard actions Must be available on PATH as git.
nvim-treesitter Optional richer syntax highlighting If present in Neovim's standard runtime path, Glance picks it up while running in --clean mode.
Install details

The bootstrap installer resolves the latest GitHub release by default.

Pin a release:

curl -fsSL https://raw.githubusercontent.com/polyphilz/glance/main/install.sh | GLANCE_REF=v0.1.0 bash

Install unreleased main:

curl -fsSL https://raw.githubusercontent.com/polyphilz/glance/main/install.sh | GLANCE_REF=main bash

Install from a local checkout:

./install.sh

Verify the installed version:

glance --version

The bootstrap installer downloads Glance into ~/.local/share/glance/<ref> and creates a symlink at ~/.local/bin/glance.

Running ./install.sh from a local checkout creates a symlink at ~/.local/bin/glance that points back to that checkout. That checkout needs to stay in a stable location after installation.

~/.local/bin must be on your PATH.

Usage

Launch Glance from the root of any Git repo, or from any subdirectory inside it:

glance

Default keys:

Key Action
<CR> Open the selected file
q Quit Glance or close the current diff
r Refresh the file tree and diff state
J / K Jump between file tree sections
<Tab> Toggle the file tree
s Stage the selected file
S Stage all supported repo changes
u Unstage the selected file
U Unstage all supported staged changes
c Commit the staged set in a floating editor
L Open the read-only git log modal
d Discard the selected file after confirmation
D Discard all repo changes after confirmation

Pane navigation uses Neovim's built-in window commands by default, so <C-w><Left>, <C-w><Right>, <C-w><Up>, and <C-w><Down> work in Glance, along with <C-w>h/j/k/l.

Inside the git log modal, use j / k to move between commits, <CR> to preview the selected commit, y to copy the full hash, r to refresh, and q to go back or close.

Configuration

Glance loads an optional Lua config file automatically. The most common location is ~/.config/glance/config.lua, or you can point GLANCE_CONFIG at a custom file.

Create a starter config automatically:

glance init-config

If you want to overwrite an existing config file:

glance init-config --force

The config file must return a Lua table.

Example:

return {
  app = {
    hide_statusline = true,
  },
  theme = {
    preset = 'one_light',
  },
  minimap = {
    width = 2,
  },
  windows = {
    filetree = {
      width = 36,
    },
    diff = {
      relativenumber = false,
    },
  },
  log = {
    max_commits = 200,
  },
  filetree = {
    show_legend = false,
  },
}

Add custom pane-navigation aliases if you want alternatives to Neovim's built-in <C-w> window commands. If your terminal or tmux reports those keys as arrows, use the tokens Neovim actually sees:

return {
  pane_navigation = {
    left = '<Left>',
    down = '<Down>',
    up = '<Up>',
    right = '<Right>',
  },
}

These are extra aliases. Glance does not disable Neovim's built-in <C-w> window navigation.

Themes

Glance ships with two built-in theme presets:

  • seti_black
  • one_light

seti_black is the default. Switch presets with theme.preset, and layer theme.palette overrides on top when you want to tune individual colors.

return {
  theme = {
    preset = 'one_light',
  },
}
Diagonal split comparison of the seti_black and one_light Glance theme presets
Config reference

Search order:

  1. $GLANCE_CONFIG
  2. $XDG_CONFIG_HOME/glance/config.lua
  3. ~/.config/glance/config.lua

Available top-level config domains:

  • app
  • theme
  • windows
  • filetree
  • log
  • keymaps
  • pane_navigation
  • hunk_navigation
  • signs
  • welcome
  • minimap
  • watch

Built-in theme presets:

  • seti_black
  • one_light

Notes:

  • Top-level flat keys like hide_statusline = true are not supported. Use the nested schema.
  • theme.preset selects a built-in palette, and theme.palette can override individual colors on top of that preset.
  • welcome.animate controls whether the welcome screen animation runs.
  • watch.enabled keeps .git metadata watchers on. watch.poll controls background worktree polling for new untracked/external file changes.
  • Discard actions always prompt for confirmation before changing the repo state.
Troubleshooting
  • glance: command not found ~/.local/bin is probably not on your PATH. Run this to fix it:

    case ":$PATH:" in
      *":$HOME/.local/bin:"*) echo "~/.local/bin already on PATH" ;;
      *)
        case "${SHELL##*/}" in
          zsh) rc="${ZDOTDIR:-$HOME}/.zshrc" ;;
          bash) rc="$HOME/.bashrc" ;;
          *) rc="$HOME/.profile" ;;
        esac
        line='export PATH="$HOME/.local/bin:$PATH"'
        grep -qxF "$line" "$rc" 2>/dev/null || printf '\n%s\n' "$line" >> "$rc"
        export PATH="$HOME/.local/bin:$PATH"
        echo "Added ~/.local/bin to PATH in $rc"
        ;;
    esac
  • glance: not a git repository Glance only runs inside a Git work tree.

  • Syntax highlighting looks limited Install nvim-treesitter in Neovim's standard runtime path for richer highlighting while Glance runs in --clean mode.

Roadmap

Glance is still focused on the local review loop. Near-term work includes:

  • Hunk-level stage, unstage, and discard
  • Better coverage for renames, binary files, copied / type-changed entries, and conflicts
  • Filetree filtering and path search for larger changesets
  • File-scoped history, plus better commit-loop ergonomics like amend and fixup

License

MIT

About

Review git diffs ~aesthetically~. A standalone TUI that serves as a drop-in replacement for VS Code/Cursor's git diff view

Topics

Resources

License

Stars

Watchers

Forks

Contributors