From 098351a9bbce485d56b8a2f44cc4ca0ad9ad943e Mon Sep 17 00:00:00 2001 From: Kris Leech Date: Fri, 27 Sep 2013 09:46:24 +0100 Subject: [PATCH] FishFace theme [#67] --- themes/fishface/README.md | 5 +++++ themes/fishface/fish_prompt.fish | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 themes/fishface/README.md create mode 100644 themes/fishface/fish_prompt.fish diff --git a/themes/fishface/README.md b/themes/fishface/README.md new file mode 100644 index 0000000..57eb507 --- /dev/null +++ b/themes/fishface/README.md @@ -0,0 +1,5 @@ +## FishFace + +Shows an ASCII fish which is blue or green when in a git repo. + +![fishface theme](https://https://f.cloud.github.com/assets/66143/1224622/ec9660d8-2750-11e3-9c96-cb7a5a69eada.png) diff --git a/themes/fishface/fish_prompt.fish b/themes/fishface/fish_prompt.fish new file mode 100644 index 0000000..457922b --- /dev/null +++ b/themes/fishface/fish_prompt.fish @@ -0,0 +1,20 @@ +# name: FishFace + +function _git_branch_name + echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') +end + +function _is_git_dirty + echo (command git status -s --ignore-submodules=dirty ^/dev/null) +end + +function fish_prompt + set -l blue (set_color -o blue) + set -l green (set_color -o green) + + if [ (_git_branch_name) ] + echo -n -s "$green><(((\"> " + else + echo -n -s "$blue><(((\"> " + end +end