Skip to content

Instantly share code, notes, and snippets.

@tdaron
Last active May 24, 2024 18:06
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() ++ " " ++ branches.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

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