Skip to content
j03-devPublic

About

Helix-native Git UI plugin written in Steel Scheme

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Latest commit

 

History

51 Commits

Folders and files

Repository files navigation

xit.hx

A Helix-native Git UI written in Steel Scheme.

Screenshot

xit.hx Git UI

Install

Requires Helix with Steel scripting support, git, bash, python3, and a C compiler (cc, or set CC=gcc / CC=clang).

git clone https://github.com/j03-dev/xit.hx.git
cd xit.hx
./install.sh

The installer copies xit.scm and its Git layer xit-core.scm into your Steel cogs, installs notify.hx, the xit query, language registration, and builds the grammar. You only require xit.scm; the core module is loaded from the same directory automatically. It does not edit Helix source. Restart Helix after installing.

Helix config

This is the only config needed in ~/.config/helix/init.scm:

(require "xit/xit.scm")

(keymap (global)
  (normal
    (space
      (g ":Git")))))

space g opens the Git status buffer. If you do not want a shortcut, only keep the require line and run :Git manually.

All other keys are native Helix or xit buffer keymaps installed automatically. File paths containing spaces, Unicode characters, or glob-like characters are handled literally, so no manual quoting is needed.

Use

Action Key
Open Git status space g or :Git
Stage file / section / selection s
Unstage file / section / selection u
Open commit editor c
Commit type message above the scissors separator, then :w (the staged diff below it is display-only)
Abort commit q (Esc stays native and never aborts)
Discard changes / selection D
View diff in *git-diff* :git-diff (or :Git diff); selected files via :git-diff-selection
Fold / unfold a file's diff inline ret or tab
Open file o
Open branch manager b or :Git branches
Open full branch graph g in *git-branches* or :Git graph
Refresh status r
Close xit buffer q
Show all keys ?

For selection staging, use normal Helix selection (v, V, C-j, multiple cursors) over file lines, then press s, u, or D to stage, unstage, or discard those files. To view a combined diff of a selection, use :git-diff-selection. A folded file shows > before its name; press ret or tab to unfold it into v and show its diff directly underneath. The d key is intentionally unbound; diffs stay accessible via commands and inline folds.

More keys in *git*: C amend commit, O / T resolve conflicts, S / U stage or unstage all, P / p push or pull. Pushing a branch with no upstream uses git push -u origin <branch> when origin exists. Closing with q, committing (or aborting), and pulling reload all open Helix files from disk.

The Head: line shows the current branch, upstream, ahead/behind counts and whether it needs a push or pull. The Commit Graph section shows the full history of every local branch, with remote-only commits and remote decorations hidden. Commit rows are hash author graph subject; hash and author are padded so the graph starts in one column, while the graph itself is not padded so the message stays immediately after it. Every commit node is o. Lazygit-style pipe cells join merge rails instead of leaving broken spans such as o ─╮:

2b2da3c FITAHIANA Nomeni... o─╮ merge side
6d314d9 FITAHIANA Nomeni... │ o side1
a3b16c2 A                   │ o base
45c916a Very Long Author... o side

Authors longer than 19 characters are shortened to 16 characters plus ..., so FITAHIANA Nomeniavo Joe appears as FITAHIANA Nomeni.... Each lane is drawn with two characters per cell, so a curved ╮ / ╯ is connected by a ─ bridge in the same graph prefix. Non-breaking spaces keep author/graph and graph/message visibly separated while the author stays inside its own highlight capture. The merge subject names the branch that was merged in, and the ← branch decoration identifies the branch it landed on; the branch name uses the diff color. Tree-sitter gives hashes, authors, graph glyphs, commit messages and branch names separate highlight captures, so each uses a different color from the active Helix theme.

Unfolding a file's inline diff does not break the surrounding section: later files keep their modified/added/deleted colors, and the M status letter keeps its diff color too.

Branch manager

*git-branches* lists every local branch with its upstream, ahead/behind counts, status, last commit and subject.

Action Key
Check out branch ret
Diff current branch against selected (current...selected) tab
Create and switch to new branch from selected branch c
Delete selected branch D
Merge selected branch into current branch M
Open full branch graph g
Pull / push p / P
Refresh / close / help r / q / ?

Delete and discard require typed confirmation before they run. Branch deletion uses git branch -D; deleting the current branch is still refused. Merging uses git merge --no-ff --no-edit -m "Merge branch '<branch>'", so even a fast-forward merge creates a merge commit with that message and the branch stays visible in the graph. The full graph in *git-graph* can be refreshed with r and closed with q.

Highlighting

Applied automatically:

  • *git*, *git-branches*, *git-graph* → xit (hashes, authors, graph glyphs, branches, sections, status entries)
  • *git-commit* → git-commit
  • *git-diff* → diff

Verify

hx --health xit

You should see Tree-sitter parser: ✓ and Highlight queries: ✓.

Update

cd xit.hx
git pull
./install.sh

Restart Helix after updating.

If something is wrong

  • :Git missing: check (require "xit/xit.scm") in init.scm.
  • No highlighting: run ./install.sh and restart Helix.
  • #false in the status line: your cog is old; run ./install.sh.

About

Helix-native Git UI plugin written in Steel Scheme

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages