hm cleanup
This commit is contained in:
parent
4eedb65822
commit
5d7ab7c414
18 changed files with 534 additions and 328 deletions
60
home-manager/shared/programs/shell/fish/functions.nix
Normal file
60
home-manager/shared/programs/shell/fish/functions.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
nix-shell = {
|
||||
wraps = "nix-shell";
|
||||
body = ''
|
||||
command nix-shell $argv --command "fish"
|
||||
'';
|
||||
};
|
||||
nix = {
|
||||
wraps = "nix";
|
||||
body = ''
|
||||
if status is-interactive
|
||||
and test (count $argv) = 1 -a "$argv[1]" = develop
|
||||
nix develop --command (status fish-path)
|
||||
else
|
||||
command nix $argv
|
||||
end
|
||||
'';
|
||||
};
|
||||
fish_jj_prompt = {
|
||||
body = ''
|
||||
if not command -sq jj
|
||||
return 1
|
||||
end
|
||||
|
||||
if not jj root &>/dev/null
|
||||
return 1
|
||||
end
|
||||
|
||||
# Generate prompt
|
||||
set -l info "$(
|
||||
jj log --ignore-working-copy --no-graph --color=always --revisions=@ --template "
|
||||
separate(
|
||||
' ',
|
||||
self.change_id().shortest(),
|
||||
bookmarks.join(', '),
|
||||
if(conflict, label('conflict', '×')),
|
||||
if(empty, label('empty', '(empty)')),
|
||||
if(divergent, label('divergent', '(divergent)')),
|
||||
if(hidden, label('hidden', '(hidden)')),
|
||||
)
|
||||
"
|
||||
)"
|
||||
or return 1
|
||||
|
||||
if test -n $info
|
||||
printf ' (jj: %s)' $info
|
||||
else
|
||||
return 1
|
||||
end
|
||||
'';
|
||||
};
|
||||
fish_vcs_prompt = {
|
||||
body = ''
|
||||
fish_jj_prompt $argv
|
||||
or fish_git_prompt $argv
|
||||
or fish_hg_prompt $argv
|
||||
or fish_fossil_prompt $argv
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue