fish: functions: Add jujutsu information to prompt
fish shell prompt for jujutsu is copied from https://gist.github.com/hroi/d0dc0e95221af858ee129fd66251897e
This commit is contained in:
parent
cf5e3874b5
commit
24de7dc771
2 changed files with 40 additions and 1 deletions
38
fish/.config/fish/functions/fish_jj_prompt.fish
Normal file
38
fish/.config/fish/functions/fish_jj_prompt.fish
Normal file
|
@ -0,0 +1,38 @@
|
|||
function fish_jj_prompt --description 'Write out the jj prompt'
|
||||
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
|
|
@ -31,7 +31,8 @@ function fish_prompt
|
|||
end
|
||||
echo -n ' '
|
||||
|
||||
fish_custom_git_prompt
|
||||
fish_jj_prompt
|
||||
or fish_custom_git_prompt
|
||||
|
||||
if [ "$command_status" -eq 0 ]
|
||||
set_color brcyan
|
||||
|
|
Loading…
Reference in a new issue