mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-22 13:04:10 +08:00
Added theme "Zish" and preview
This commit is contained in:
parent
0f14f1cd7a
commit
ab57fc1d97
37
themes/zish/fish_prompt.fish
Normal file
37
themes/zish/fish_prompt.fish
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# name: Zish
|
||||||
|
|
||||||
|
function _is_git_dirty
|
||||||
|
echo (command git status -s --ignore-submodules=dirty ^/dev/null)
|
||||||
|
end
|
||||||
|
|
||||||
|
function fish_prompt
|
||||||
|
set_color -o red
|
||||||
|
printf '┌─<'
|
||||||
|
set_color -o blue
|
||||||
|
printf '%s ' (whoami)
|
||||||
|
set_color $fish_color_autosuggestion[1]
|
||||||
|
printf '@ '
|
||||||
|
set_color cyan
|
||||||
|
printf '%s ' (hostname|cut -d . -f 1)
|
||||||
|
set_color $fish_color_autosuggestion[1]
|
||||||
|
printf 'in '
|
||||||
|
set_color -o green
|
||||||
|
printf '%s' (prompt_pwd)
|
||||||
|
set_color -o red
|
||||||
|
printf '>'
|
||||||
|
|
||||||
|
echo
|
||||||
|
set_color -o red
|
||||||
|
printf '└─<'
|
||||||
|
set_color yellow
|
||||||
|
printf '%s' (__fish_git_prompt)
|
||||||
|
if [ (_is_git_dirty) ]
|
||||||
|
set_color blue
|
||||||
|
printf '* '
|
||||||
|
end
|
||||||
|
set_color -o red
|
||||||
|
printf '>──'
|
||||||
|
set_color yellow
|
||||||
|
printf '» '
|
||||||
|
set_color normal
|
||||||
|
end
|
12
themes/zish/fish_right_prompt.fish
Normal file
12
themes/zish/fish_right_prompt.fish
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
function fish_right_prompt
|
||||||
|
set -l exit_code $status
|
||||||
|
if test $exit_code -ne 0
|
||||||
|
set_color red
|
||||||
|
else
|
||||||
|
set_color green
|
||||||
|
end
|
||||||
|
printf '%d' $exit_code
|
||||||
|
set_color yellow
|
||||||
|
printf ' < %s' (date +%H:%M:%S)
|
||||||
|
set_color normal
|
||||||
|
end
|
BIN
themes/zish/zish_preview.png
Normal file
BIN
themes/zish/zish_preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
Loading…
x
Reference in New Issue
Block a user