Changes from work
This commit is contained in:
parent
75c6271f5d
commit
cfd12d404e
9 changed files with 312 additions and 2 deletions
3
fish/functions/fish_mode_prompt.fish
Normal file
3
fish/functions/fish_mode_prompt.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function fish_mode_prompt
|
||||
# NOOP - Disable vim mode indicator
|
||||
end
|
||||
48
fish/functions/fish_prompt.fish
Normal file
48
fish/functions/fish_prompt.fish
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
function fish_prompt
|
||||
set -l last_command_status $status
|
||||
|
||||
set -l symbol 'π'
|
||||
|
||||
set -l normal_color (set_color normal)
|
||||
set -l branch_color (set_color yellow)
|
||||
set -l meta_color (set_color red)
|
||||
set -l symbol_color (set_color blue -o)
|
||||
set -l error_color (set_color red -o)
|
||||
|
||||
if git_is_repo
|
||||
echo -n -s $branch_color (git_branch_name) $normal_color
|
||||
set -l git_meta ""
|
||||
if test (command git ls-files --others --exclude-standard | wc -w 2> /dev/null) -gt 0
|
||||
set git_meta "$git_meta?"
|
||||
end
|
||||
if test (command git rev-list --walk-reflogs --count refs/stash 2> /dev/null)
|
||||
set git_meta "$git_meta\$"
|
||||
end
|
||||
if git_is_touched
|
||||
git_is_dirty && set git_meta "$git_meta⨯"
|
||||
git_is_staged && set git_meta "$git_meta●"
|
||||
end
|
||||
set -l commit_count (command git rev-list --count --left-right (git remote)/(git_branch_name)"...HEAD" 2> /dev/null)
|
||||
if test $commit_count
|
||||
set -l behind (echo $commit_count | cut -f 1)
|
||||
set -l ahead (echo $commit_count | cut -f 2)
|
||||
if test $behind -gt 0
|
||||
set git_meta "$git_meta🠋"
|
||||
end
|
||||
if test $ahead -gt 0
|
||||
set git_meta "$git_meta🠉"
|
||||
end
|
||||
end
|
||||
if test $git_meta
|
||||
echo -n -s $meta_color " " $git_meta " " $normal_color
|
||||
else
|
||||
echo -n -s " "
|
||||
end
|
||||
end
|
||||
|
||||
if test $last_command_status -eq 0
|
||||
echo -n -s $symbol_color $symbol " " $normal_color
|
||||
else
|
||||
echo -n -s $error_color $symbol " " $normal_color
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue