Go to file
2025-10-02 16:54:15 -05:00
lua/jj_mini_diff Fix module loading issues and improve config handling 2025-10-02 16:53:12 -05:00
GEMINI.md Add agent instructions to GEMINI.md 2025-10-02 16:07:09 -05:00
README.md Fix module loading issues and improve config handling 2025-10-02 16:53:12 -05:00

jj-mini.diff

A Neovim plugin to provide mini.diff-like functionality for Jujutsu (jj) repositories, with a focus on displaying Git signs for changes.

Features

  • Jujutsu Git Signs: Visually indicate added, modified, and deleted lines directly in your Neovim buffer, reflecting changes in your jj working copy.
  • Seamless Integration: Designed to integrate smoothly with Neovim's existing diff capabilities and user interface.

Installation

You can install jj-mini.diff using your favorite Neovim plugin manager.

lazy.nvim:

{
  "your-github-username/jj-mini.diff", -- Replace with the actual repository path
  config = function()
    require("jj_mini_diff").setup({
      -- Your configuration options here
    })
  end,
}

Usage

To activate the plugin, call the setup() function in your Neovim configuration:

require("jj_mini_diff").setup({
  -- Optional: Customize signs or autocmd events
  -- signs = {
  --   add = { text = "++", texthl = "DiffAdd", numhl = "DiffAdd" },
  --   change = { text = "//", texthl = "DiffChange", numhl = "DiffChange" },
  --   delete = { text = "--", texthl = "DiffDelete", numhl = "DiffDelete" },
  -- },
  -- autocmd_events = { "BufReadPost", "BufWritePost", "CursorHold", "InsertLeave" },
})

The plugin will automatically place and update signs in files within a Jujutsu repository on BufReadPost, BufWritePost, and CursorHold events by default.

You can also manually refresh the signs for the current buffer at any time:

:lua require("jj_mini_diff").refresh_signs()

Configuration

The setup() function accepts an optional table for configuration.

require("jj_mini_diff").setup({
  signs = {
    add = { text = "│", texthl = "JjDiffAdd", numhl = "JjDiffAdd" },
    change = { text = "│", texthl = "JjDiffChange", numhl = "JjDiffChange" },
    delete = { text = "─", texthl = "JjDiffDelete", numhl = "JjDiffDelete" },
  },
  autocmd_events = { "BufReadPost", "BufWritePost", "CursorHold" },
})
  • signs: A table to customize the text, text highlight group (texthl), and number highlight group (numhl) for each sign type.
    • add: For added lines.
    • change: For changed lines.
    • delete: For deleted lines.
  • autocmd_events: A list of Neovim autocommand events that will trigger a sign refresh.