-
-
Save marcusandre/85e8b455c66e7c2754b33ae6d07c6b5c to your computer and use it in GitHub Desktop.
Jujutsu (jj) prompt for fish-shell and custom tide item prompt integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _tide_item_jj | |
if not command -sq jj | |
return 1 | |
end | |
if not jj root --quiet &>/dev/null | |
return 1 | |
end | |
jj log --ignore-working-copy --no-graph --color always -r @ -T ' | |
surround( | |
" (", | |
")", | |
separate( | |
" ", | |
bookmarks.join(", "), | |
coalesce( | |
surround( | |
"\"", | |
"\"", | |
if( | |
description.first_line().substr(0, 24).starts_with(description.first_line()), | |
description.first_line().substr(0, 24), | |
description.first_line().substr(0, 23) ++ "…" | |
) | |
), | |
"(no description set)" | |
), | |
change_id.shortest(), | |
commit_id.shortest(), | |
if(conflict, "(conflict)"), | |
if(empty, "(empty)"), | |
if(divergent, "(divergent)"), | |
if(hidden, "(hidden)"), | |
) | |
) | |
' | |
end |
Thank you for sharing this!
This works really well, thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To make this a
tide
item, just follow https://github.com/IlanCosman/tide/wiki/Custom-items-(prompt-segments). But here are the steps:funcsave
or move_tide_item_jj.fish
into.config/fish/functions
set --append tide_right_prompt_items jj
(tide_left_prompt_items
to add it to the left side)