mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-03-15 17:16:20 +08:00
Added bira theme (based on ZSH bira theme)
This commit is contained in:
parent
def3de14ae
commit
0a609a6e23
43
themes/bira/fish_prompt.fish
Normal file
43
themes/bira/fish_prompt.fish
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# Theme based on Bira theme from oh-my-zsh: https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/bira.zsh-theme
|
||||||
|
# Some code stolen from oh-my-fish clearance theme: https://github.com/bpinto/oh-my-fish/blob/master/themes/clearance/
|
||||||
|
|
||||||
|
function __user_host
|
||||||
|
echo -n (set_color --bold green)$USER@(hostname|cut -d . -f 1) (set color normal)
|
||||||
|
end
|
||||||
|
|
||||||
|
function __current_path
|
||||||
|
echo -n (set_color --bold blue) (pwd) (set_color normal)
|
||||||
|
end
|
||||||
|
|
||||||
|
function _git_branch_name
|
||||||
|
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
|
||||||
|
end
|
||||||
|
|
||||||
|
function _git_is_dirty
|
||||||
|
echo (command git status -s --ignore-submodules=dirty ^/dev/null)
|
||||||
|
end
|
||||||
|
|
||||||
|
function __git_status
|
||||||
|
if [ (_git_branch_name) ]
|
||||||
|
set -l git_branch (_git_branch_name)
|
||||||
|
|
||||||
|
if [ (_git_is_dirty) ]
|
||||||
|
set git_info '<'$git_branch"*"'>'
|
||||||
|
else
|
||||||
|
set git_info '<'$git_branch'>'
|
||||||
|
end
|
||||||
|
|
||||||
|
echo -n (set_color yellow) $git_info (set_color normal)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function fish_prompt
|
||||||
|
set -l white (set_color white)
|
||||||
|
|
||||||
|
echo -n (set_color white)"╭─"(set_color normal)
|
||||||
|
__user_host
|
||||||
|
__current_path
|
||||||
|
__git_status
|
||||||
|
echo -e ''
|
||||||
|
echo (set_color white)"╰─"(set_color --bold white)"\$ "(set_color normal)
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user