Created
January 25, 2018 21:25
-
-
Save johnmarinelli/250de95229a0c06f9da0808c2723cf7a to your computer and use it in GitHub Desktop.
place this in $OMF_PATH/themes/bira/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/ | |
# I replaced the ruby version with node version. - John | |
function __user_host | |
set -l content | |
if [ (id -u) = "0" ]; | |
echo -n (set_color --bold red) | |
else | |
echo -n (set_color --bold green) | |
end | |
echo -n $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 __ruby_version | |
set ruby_version "" | |
if type "rvm-prompt" > /dev/null 2>&1 | |
set ruby_version (rvm-prompt i v g) | |
else if type "rbenv" > /dev/null 2>&1 | |
set ruby_version (rbenv version-name) | |
end | |
echo -n (set_color red)‹$ruby_version› (set_color normal) | |
end | |
function __node_version | |
if type "node" > /dev/null 2>&1 | |
set node_version (node -v) | |
else if type "nvm" > /dev/null 2>&1 | |
set node_version (nvm current) | |
else | |
set node_version "" | |
end | |
echo -n (set_color blue)‹$node_version› (set_color normal) | |
end | |
function fish_prompt | |
echo -n (set_color white)"╭─"(set_color normal) | |
__user_host | |
__current_path | |
__node_version | |
__git_status | |
echo -e '' | |
echo (set_color white)"╰─"(set_color --bold white)"\$ "(set_color normal) | |
end | |
function fish_right_prompt | |
set -l st $status | |
if [ $st != 0 ]; | |
echo (set_color red) ↵ $st(set_color normal) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment