Open lazygit in an embedded, floating terminal inside Helix, and automatically reload your open buffers when you quit. Built on top of steel-pty.
:lazygit-open drops you into lazygit for the current project; :lazygit-open-here
opens it for the repository containing the file you're editing. Quit lazygit with
q and the panel tears itself down and refreshes anything git changed on disk.
- A build of Helix with the Steel plugin system (the
mattwparas/helixsteel-event-systembranch), and theforgepackage manager that ships with it. lazygitinstalled and on yourPATH.- A patched steel-pty. lazygit.hx depends on
bojohnson5/steel-ptyrather than upstream, because it adds the embedded-terminal launcher this plugin calls (open-program-in-terminal/create-native-pty-system-with-cwd!) plus a number of rendering fixes lazygit needs: truecolor handling, reverse-video selections, UTF-8 handling across reads, clean process exit, and cursor visibility. Upstream steel-pty does not currently expose these, so the plugin will not work against it. The dependency is declared incog.scmandforgepulls it in for you.
Developed and tested on macOS (Apple Silicon).
forge pkg install --git https://github.com/bojohnson5/lazygit.hxThis also resolves and installs the steel-pty dependency, including building its
native dylib. Then load the plugin from your init.scm (see below) and restart
Helix.
Note:
forgecaches packages by name. If you update either repo and a reinstall reports "Already up to date," clear the cached copies first:rm -rf ~/.local/share/steel/cog-sources/{lazygit.hx,steel-pty} \ ~/.local/share/steel/cogs/{lazygit,steel-pty} forge pkg install --git https://github.com/bojohnson5/lazygit.hx
Add the require and a keybinding to your init.scm. Requiring the plugin
registers :lazygit-open and :lazygit-open-here as typable commands.
(require "lazygit/lazygit.scm")
(require "helix/keymaps.scm")
(keymap (global)
(normal
(space
(g ":lazygit-open")
(G ":lazygit-open-here"))))space g→ open lazygit at the project rootspace G→ open lazygit for the current file's repository
You can of course bind them however you like, or invoke :lazygit-open /
:lazygit-open-here directly from the command prompt.
Two things matter for the space (which-key) menu to show these with labels:
requirethe plugin before the(keymap …)block. The menu's descriptions are built when the keymap is merged, by looking up each command's docstring — if the plugin hasn't loaded yet, the entries come out blank.- Fully restart Helix after changing
init.scm(not:config-reload), so the keymap and its menu are rebuilt.
Bind the commands to direct keys (leaves) rather than nesting them under a custom prefix if you want them labeled in the menu — user-defined prefixes render without a label.
Window size. The terminal floats centered over the editor. Adjust how much of
the screen it takes with steel-pty's set-terminal-fraction, e.g. in init.scm:
(set-terminal-fraction 9/10)lazygit is launched directly as the terminal's process (no intervening shell),
rooted at the target directory, and rendered into a floating terminal component
driven by steel-pty's PTY + terminal emulator. Because lazygit is the PTY process
itself, quitting it closes the PTY; the plugin detects that, removes the panel, and
runs :reload-all so buffers touched by git operations (checkouts, resets, stashes)
are re-read from disk.
- Verbose commits open
$EDITORinside the panel. PressingC/efor a full commit message makes lazygit spawn$EDITORinside the embedded terminal. Set lazygit'sgit.commit.verboseoff, pointcore.editorat something lightweight, or use lazygit's inline commit input, which doesn't shell out. - Requires the steel-pty fork described under Requirements; it will not work with upstream steel-pty.
- Text attributes beyond color (bold, italic, underline) are not currently rendered, so some elements may look flatter than in a standalone terminal. Colors, selections, and unicode render correctly.
Built on steel-pty by @mattwparas, which provides the PTY and terminal emulation this plugin renders into. lazygit.nvim for the awesome neovim plugin that inspired this.
AI Disclosure: Built with the assistance of Claude Opus 4.8