From b0de89e069af9f1e10cb722c7e226ff6505ee7c0 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Tue, 30 Dec 2025 11:11:10 +0100 Subject: [PATCH] Update jujutsu tooling --- modules/cli/tools/jujutsu.nix | 11 +++++++++-- modules/cli/zsh/default.nix | 14 +++++++++++++- modules/cli/zsh/init.zsh | 7 +++++-- modules/cli/zsh/prompt.zsh | 4 +--- nvim/default.nix | 1 + 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/modules/cli/tools/jujutsu.nix b/modules/cli/tools/jujutsu.nix index ca051d1..0298b7f 100644 --- a/modules/cli/tools/jujutsu.nix +++ b/modules/cli/tools/jujutsu.nix @@ -12,6 +12,9 @@ key = "~/.ssh/id_rsa.pub"; allowed-signers = "~/.ssh/allowed_signers"; }; + fsmonitor = { + backend = "watchman"; + }; remotes = { origin = { auto-track-bookmarks = "glob:*"; @@ -20,8 +23,12 @@ auto-track-bookmarks = "exact:master | exact:main"; }; }; - fsmonitor = { - backend = "watchman"; + aliases = { + tug = ["bookmark" "move" "--from" "closest_bookmark(@)" "--to" "closest_pushable(@)"]; + }; + revset-aliases = { + "closest_bookmark(to)" = "heads(::to & bookmarks())"; + "closest_pushable(to)" = ''heads(::to & mutable() & ~description(exact:" ") & (~empty() | merges()))''; }; }; }; diff --git a/modules/cli/zsh/default.nix b/modules/cli/zsh/default.nix index a7e5a1b..9eb20f8 100644 --- a/modules/cli/zsh/default.nix +++ b/modules/cli/zsh/default.nix @@ -45,6 +45,19 @@ gcpf = "gaa && gcamn && gpf"; gcpfn = "gcamn && gpf"; + ## jj + js = "jj st"; + jn = "jj new"; + jnm = "jj new 'trunk()'"; + jc = "jj commit"; + jcm = "jj commit -m"; + je = "jj edit"; + jb = "jj bookmark"; + jp = "jj git push"; + jf = "jj git fetch"; + jl = "jj log"; + jla = "jj log -r 'all()'"; + # k8s k = "kubectl"; kubectl = "kubecolor"; @@ -201,7 +214,6 @@ # disable space between right prompt and end of line ZLE_RPROMPT_INDENT=0 '') - (lib.mkOrder 950 "source ${pkgs.gitstatus}/share/gitstatus/gitstatus.prompt.zsh") (lib.mkOrder 951 (builtins.readFile ./prompt.zsh)) (lib.mkOrder 1000 (builtins.readFile ./init.zsh)) (lib.mkOrder 1400 '' diff --git a/modules/cli/zsh/init.zsh b/modules/cli/zsh/init.zsh index 7ffb471..c9c63c8 100644 --- a/modules/cli/zsh/init.zsh +++ b/modules/cli/zsh/init.zsh @@ -48,7 +48,7 @@ nixify() { {pkgs ? import {}}: pkgs.mkShell { packages = with pkgs; [ - + ]; } EOF @@ -85,7 +85,10 @@ touchp() { } s() { - git status 2>/dev/null + jj st 2>/dev/null + if [[ $? -ne 0 ]]; then + git status 2>/dev/null + fi if [[ $? -ne 0 ]]; then gfold fi diff --git a/modules/cli/zsh/prompt.zsh b/modules/cli/zsh/prompt.zsh index e303a2e..8da3f8a 100644 --- a/modules/cli/zsh/prompt.zsh +++ b/modules/cli/zsh/prompt.zsh @@ -44,8 +44,6 @@ NEWLINE=$'\n' WORKDIR='%B%F{blue}%~%b%f' RO='%F{red}$([ -w . ] || echo ':ro")%f" -# from gitstatusd, sourced before this prompt script -GIT='${GITSTATUS_PROMPT:+ ($GITSTATUS_PROMPT)}' KUBE='%F{cyan}$KCTX${KNS:+/$KNS}%f' PROMPT_SHLVL='%(?.%F{green}.%F{red})$(printf "❯%.0s" {1..$SHLVL})%f' @@ -53,5 +51,5 @@ EXEC_TIME="" EXIT_CODE='%(?.. %F{red}x${(j[|])pipestatus}%f)' JOBS='%F{cyan}%(1j. &%j.)%f' -export PROMPT="${FILL}${NEWLINE}${WORKDIR}$RO$GIT $KUBE $PROMPT_SHLVL " +export PROMPT="${FILL}${NEWLINE}${WORKDIR}$RO $KUBE $PROMPT_SHLVL " export RPROMPT="\${EXEC_TIME}${EXIT_CODE}${JOBS}" diff --git a/nvim/default.nix b/nvim/default.nix index 996b8dd..ddf4946 100644 --- a/nvim/default.nix +++ b/nvim/default.nix @@ -74,6 +74,7 @@ in harpoon2 gitsigns-nvim + # jj-nvim vim-fugitive vim-rhubarb git-conflict-nvim