jceb/jiejie.nvim

github github
git
stars 71
issues 0
subscribers 1
forks 1
CREATED

UPDATED


jiejie

Neovim plugin that adds support for the Jujutsu source control management system. The design is heavily inspired by vim-fugitive.

jiejie

Usage

jiejie provides a large amount of key mappings in the status log window to expose as much of jujutsu's functionality as possible. For remembering the mappings more easily, these rules might prove helpful:

  • The current change (@) is at the center of all interactions. Rebasing a commit, squashing changes, all references the current change.
  • When the cursor is on another change, this other change becomes the target of the operation, e.g. the current change (@) is rebased upon the change under the cursor.
  • Breaking operations, e.g. moving a bookmark backwards (--allow-backwards) or modifying an immutable change (--ignore-immutable), can be achieved by adding a leading ! to the mapping.
  • Destructive operations or operations that prompt the user for an arbitrary change id use upper case letters, e.g. cbM for moving an arbitrary bookmark to the change under the cursor.
  • Shortcuts follow jujutsu's aliases where possible, e.g. all bookmark related cb mappings start with c (change) and b (bookmark alias).

Features

UX very close to tpope's vim-fugitive

  • Edit file (<CR>, o, gO, O)
  • Edit file at a certain revision (:Jedit [revision]:[file], or by selecting the file in the status log window via <CR>, o, gO, O)
  • Open full change in preview window (K)
  • Toggle inline diff (=)
  • Compare multiple versions of a file (d?, :Jdiffsplit [revision], dD, dd, dV, dv, dS, ds, dH, dh, dq)
  • Wraper for jj CLI (:J or :Jj)
  • Show help (g?, c?, d?, r?, s?)
  • Use quickfix and location list to navigate the change history via JcLog and JlLog

Status log buffer (:J, :JJ, :Jj, :JJ log)

  • Includes the list of modified files alongside the status log
  • Adjust view of displayed log entries (s?, sA, sa, sB,sb, sd, sf, sr, sq, ss, 1ss, ..ss, sT, st)
  • Navigation between changes, files and hunks ((, ), {, }, [m, ]m, [[, ]], <Tab>)
  • Increase or decrease the number of log entries shown (<C-a>, <C-x>)
  • Close status log buffer (q, gq)
  • Reload status log (R)
  • Populate a : or :! command with the file under the cursor (., !!)
  • Exclude revsets, e.g. bookmarks, from being displayed via configuration options.

Modify commits from the status log buffer

  • Add ! prefix to mappings when modifying immutable changes
  • Edit change (<CR>)
  • Pull and push changes to git (gu, gP, gp, grA, gra, grB, grb, grT, grt)
  • Modify change description in an editor window (ce) or quick edit the first line (cd)
  • Copy change description of change / commit ID (yy, yc, yC)
  • Create a new change (c?, A, a, cA, ca, cI, ci, i, I, cn)
  • Create a merge commit (cm, cM, crB, crr, crR)
  • Commit change or file under the cursor (cc)
  • Squash change or file into parent or into the change under the cursor (cs, cS)
  • Duplicate / cherry-pick change under the cursor (cpP, cpp, cpM, cpm, cpT, cpt)
  • Revert change under the cursor (cR)
  • Abandon change or file under the cursor (X)
  • Rebase branch, tree or individual change (r?, <<, >>, rbD, rbd, rbH, rbh, rbM, rbm, rbO, rbo, rbt, rD, rd, rO, ro, rR, rr, rtD, rtd, rtO, rto, rtt rtT)
  • Undo / redo last operation (u, <C-r>)
  • Bookmark management (cba, cbb, cbc, cbd, cbF, cbf, cbM, cbm, cbR, cbr, cbT, cbt, cbu, cbX, cbx)
  • Tag management (ctc, ctm, ctt, ctX, ctx)
  • Untrack and track files (x, !x)
  • Focus / open operation log (so, sO)
  • Focus / open evolog (se, sE)

Operation log buffer (:J oplog)

  • Focus / open status log buffer (so, sO)
  • Restore repository at operation (<CR>)
  • Close operation log buffer (q)
  • Reload operation log (R)
  • Open full change in preview window (K)
  • Increase or decrease the number of log entries shown (<C-a>, <C-x>)

Evolog buffer (:J evolog)

  • Focus / open status log buffer (se, sE)
  • Edit change (<CR>)
  • Close operation log buffer (q)
  • Reload operation log (R)
  • Open full change in preview window (K)
  • Increase or decrease the number of log entries shown (<C-a>, <C-x>)

Installation

With Lazy, add this configuration to nvim:

{
  -- https://github.com/jceb/jiejie.nvim
  "jceb/jiejie.nvim",
}

With vim.pack add this configuration to nvim:

vim.pack.add({ "https://github.com/jceb/jiejie.nvim" })

Configuration

Available configuration options: see https://github.com/jceb/jiejie.nvim/blob/feat/exclude-revsets/lua/jiejie/config.lua

With Lazy:

{
  -- https://github.com/jceb/jiejie.nvim.git
  "jceb/jiejie.nvim",
  -- Custom configuration settings
  opts = {
      -- Excluded revset expression, see https://docs.jj-vcs.dev/latest/revsets/ for the full language
    excluded_revset = 'bookmarks(glob:"renovate/*") | tracked_remote_bookmarks(glob:"renovate/*") | untracked_remote_bookmarks(glob:"renovate/*")',
    default_view = 1,
    dynamic_views = {
      -- Dynamic view that dispalys all merges, see https://docs.jj-vcs.dev/latest/revsets/ for the full language
      { revset = "merges()" }
    },
    log_revisions = 10,
  }
}

With vim.pack:

vim.g.jiejie_config = {
      -- Excluded revset expression, see https://docs.jj-vcs.dev/latest/revsets/ for the full language
    excluded_revset = 'bookmarks(glob:"renovate/*") | tracked_remote_bookmarks(glob:"renovate/*") | untracked_remote_bookmarks(glob:"renovate/*")',
    default_view = 1,
    dynamic_views = {
      -- Dynamic view that dispalys all merges, see https://docs.jj-vcs.dev/latest/revsets/ for the full language
      { revset = "merges()" }
    },
    log_revisions = 10,
}

Roadmap

See ROADMAP.md.

Limitations

References

There isn't too much information about Jujutus on the web, yet. Here are a number of references that I find helpful: