Skip to content

Instantly share code, notes, and snippets.

@tdaron
Last active December 10, 2024 17:58
Show Gist options
  • Save tdaron/f5d0985687d8aed06714c8901dfb5fcb to your computer and use it in GitHub Desktop.
Save tdaron/f5d0985687d8aed06714c8901dfb5fcb to your computer and use it in GitHub Desktop.
revision picker for jj using fzf
function fzf_jj_edit
if test -d .jj
set -l name (jj log --no-graph -T 'change_id.shortest() ++ "\t" ++ description.first_line() ++ " " ++ bookmarks.join(" ") ++ "\n"' --color always | fzf --ansi | cut -f1)
commandline -it "$name"
else
commandline -it "# not in a jj directory"
end
end
bind \cj 'fzf_jj_edit'
@tdaron
Copy link
Author

tdaron commented May 24, 2024

You can just press Ctrl+j in the middle of a command to run it :)

demo

@lukerandall
Copy link

@tdaron fyi branches has been renamed bookmarks as of 0.22

@tdaron
Copy link
Author

tdaron commented Dec 9, 2024

updated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment