diff options
author | Ivan Tham <ivanthamjunhoe@gmail.com> | 2015-06-15 18:16:17 +0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2015-06-23 15:46:16 -0700 |
commit | a150ae76ac15ced7965f909e6b4b433c57321d84 (patch) | |
tree | 26ccee11d3c6217cb5efb6452282306fac9232a9 /share/tools | |
parent | 4621e763b63dd764bc96cc5fe36613b4e0404e6b (diff) |
Add sorin theme
Diffstat (limited to 'share/tools')
-rw-r--r-- | share/tools/web_config/sample_prompts/sorin.fish | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/share/tools/web_config/sample_prompts/sorin.fish b/share/tools/web_config/sample_prompts/sorin.fish new file mode 100644 index 00000000..41f02d92 --- /dev/null +++ b/share/tools/web_config/sample_prompts/sorin.fish @@ -0,0 +1,60 @@ +# Name: Sorin +# Author: Ivan Tham <ivanthamjunhoe@gmail.com> + +# If login shell, don't do anything +if status --is-login; and function fish_prompt; echo -n '% '; end; end + +function fish_prompt + if not set -q -g __prompt_sorin_functions-defined + set -g __prompt_sorin_functions-defined + end + + test $SSH_TTY; and printf (set_color red)(whoami)(set_color white)'@'(set_color yellow)(hostname)' ' + + test $USER = 'root'; and echo (set_color red)"#" + + # Main + echo -n (set_color cyan)(prompt_pwd) (set_color red)'❯'(set_color yellow)'❯'(set_color green)'❯ ' +end + +function fish_right_prompt + # last status + test $status != 0; and printf (set_color red)"⏎ " + + if git rev-parse ^ /dev/null + # Purple if branch detached else green + git branch -qv | grep "\*" | grep -q detached + and set_color purple --bold + or set_color green --bold + + # Need optimization on this block (eliminate space) + git name-rev --name-only HEAD + + # Merging state + git merge -q ^ /dev/null; or printf ':'(set_color red)'merge' + printf ' ' + + # Symbols + for i in (git branch -qv --no-color|grep \*|cut -d' ' -f4-|cut -d] -f1|tr , \n)\ + (git status --porcelain | cut -c 1-2 | uniq) + switch $i + case "*[ahead *" + printf (set_color purple)⬆' ' + case "*behind *" + printf (set_color purple)⬇' ' + case "." + printf (set_color green)✚' ' + case " D" + printf (set_color red)✖' ' + case "*M*" + printf (set_color blue)✱' ' + case "*R*" + printf (set_color purple)➜' ' + case "*U*" + printf (set_color brown)═' ' + case "??" + printf (set_color white)◼' ' + end + end + end +end |