evanphx/jjsigns.nvim
Neovim gutter support for jj
{ "createdAt": "2025-08-27T20:49:02Z", "defaultBranch": "main", "description": "Neovim gutter support for jj", "fullName": "evanphx/jjsigns.nvim", "homepage": null, "language": "Lua", "name": "jjsigns.nvim", "pushedAt": "2025-08-27T20:55:27Z", "stargazersCount": 12, "topics": [], "updatedAt": "2025-11-18T21:07:10Z", "url": "https://github.com/evanphx/jjsigns.nvim"}jjsigns.nvim
Section titled “jjsigns.nvim”A Neovim plugin that shows Jujutsu (jj) diff information in the gutter, similar to how gitsigns.nvim works for Git.
Features
Section titled “Features”- Gutter Signs: Shows
┃,▁,▔,~signs in the sign column for added, changed, and deleted lines (same as gitsigns) - Line Highlighting: Optional highlighting of modified lines
- Number Column: Optional highlighting of line numbers for modified lines
- Real-time Updates: Updates signs as you type (with debouncing for performance)
- Auto-attach: Automatically attaches to files in JJ repositories
- Customizable: Configurable signs, colors, and behavior
Requirements
Section titled “Requirements”- Neovim 0.9+
- Jujutsu (jj) executable in your PATH
Installation
Section titled “Installation”{ 'your-username/jjsigns.nvim', config = function() require('jjsigns').setup() end}use { 'your-username/jjsigns.nvim', config = function() require('jjsigns').setup() end}Configuration
Section titled “Configuration”Default Configuration
Section titled “Default Configuration”require('jjsigns').setup({ enabled = true,
attach = { auto = true, -- Auto-attach to JJ repository files },
signs = { add = { text = '┃', numhl = 'JjSignsAddNr', linehl = 'JjSignsAddLn' }, change = { text = '┃', numhl = 'JjSignsChangeNr', linehl = 'JjSignsChangeLn' }, delete = { text = '▁', numhl = 'JjSignsDeleteNr', linehl = 'JjSignsDeleteLn' }, topdelete = { text = '▔', numhl = 'JjSignsDeleteNr', linehl = 'JjSignsDeleteLn' }, changedelete = { text = '~', numhl = 'JjSignsChangeNr', linehl = 'JjSignsChangeLn' }, },
sign_priority = 6, signcolumn = true, -- Toggle with `:JjSigns toggle_signs` numhl = false, -- Toggle with `:JjSigns toggle_numhl` linehl = false, -- Toggle with `:JjSigns toggle_linehl`
-- JJ specific options base = '@-', -- Base revision to compare against (default: parent revision)
-- Performance options update_debounce = 100, -- Debounce time for updates in milliseconds})Commands
Section titled “Commands”:JjSigns setup- Setup/reinitialize the plugin:JjSigns toggle- Toggle the plugin on/off:JjSigns enable- Enable the plugin:JjSigns disable- Disable the plugin
Highlight Groups
Section titled “Highlight Groups”The plugin defines the following highlight groups:
Sign Column
Section titled “Sign Column”JjSignsAdd- Added lines signJjSignsChange- Changed lines signJjSignsDelete- Deleted lines signJjSignsTopdelete- Top deleted lines signJjSignsChangedelete- Changed+deleted lines sign
Number Column
Section titled “Number Column”JjSignsAddNr- Added lines numberJjSignsChangeNr- Changed lines numberJjSignsDeleteNr- Deleted lines numberJjSignsTopdeletNr- Top deleted lines numberJjSignsChangedeletefNr- Changed+deleted lines number
Line Highlights
Section titled “Line Highlights”JjSignsAddLn- Added lines backgroundJjSignsChangeLn- Changed lines backgroundJjSignsDeleteLn- Deleted lines backgroundJjSignsTopdeleteLn- Top deleted lines backgroundJjSignsChangedeleteLn- Changed+deleted lines background
By default, these link to the corresponding GitSigns* highlight groups if available, providing consistent styling with gitsigns.nvim.
How it Works
Section titled “How it Works”- The plugin automatically detects JJ repositories when you open files
- For tracked files, it runs
jj diffto compare the working copy with the parent revision (@-) - It parses the diff output to identify added, changed, and deleted lines
- Signs are placed in the gutter using Neovim’s extmarks API
- Signs are updated in real-time as you edit files, with debouncing for performance
Comparison with JJ
Section titled “Comparison with JJ”The plugin compares your working copy files against the base revision (default @-, the parent revision). This is equivalent to running:
jj diff --git --context=0 -r @-..@ -- path/to/fileYou can change the base revision in the configuration if you want to compare against a different revision.
Performance
Section titled “Performance”- Uses debouncing (100ms by default) to avoid excessive updates while typing
- Only processes files that are tracked in the JJ repository
- Automatically detaches from buffers when they’re unloaded
- Minimal memory footprint by storing only essential state
Troubleshooting
Section titled “Troubleshooting”Signs not appearing
Section titled “Signs not appearing”- Ensure
jjis in your PATH::!jj version - Check if you’re in a JJ repository:
:!jj status - Verify the file is tracked:
:!jj file list path/to/file - Check if the plugin is enabled:
:JjSigns toggle
Performance issues
Section titled “Performance issues”- Increase
update_debouncein the configuration - Disable
linehlornumhlif not needed
Contributing
Section titled “Contributing”Contributions are welcome! Please feel free to submit issues and pull requests.
Development
Section titled “Development”The codebase uses StyLua for formatting. To format the code:
# Install stylua (if not already installed)cargo install stylua
# Format all Lua filesstylua --config-path stylua.toml lua/ plugin/ *.luaLicense
Section titled “License”MIT License - see LICENSE file for details.
Acknowledgments
Section titled “Acknowledgments”- Inspired by gitsigns.nvim
- Built for Jujutsu VCS