From f9e1ff0cabbf64ed5fa755fe74e6e59d5c36e646 Mon Sep 17 00:00:00 2001 From: Eivind Uggedal Date: Fri, 10 May 2013 00:14:01 +0200 Subject: [PATCH] Minimal prompt theme. Displays the $CWD only. If you are connected through ssh the hostname will also be shown. I like my prompt uncluttered. If I need to know if my git repo is dirty I run `git st`. If I get lost and need to know which branch I'm on it takes my fingers 2 seconds to type `git br`. The right prompt displays the last commands exit code if it was non-zero. It requires a recent version of fish from git. --- themes/uggedal/fish_prompt.fish | 7 +++++++ themes/uggedal/fish_right_prompt.fish | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 themes/uggedal/fish_prompt.fish create mode 100644 themes/uggedal/fish_right_prompt.fish diff --git a/themes/uggedal/fish_prompt.fish b/themes/uggedal/fish_prompt.fish new file mode 100644 index 0000000..ec4bf59 --- /dev/null +++ b/themes/uggedal/fish_prompt.fish @@ -0,0 +1,7 @@ +function fish_prompt + if test -n "$SSH_CONNECTION" + printf '%s ' $HOSTNAME + end + + printf '%s ' (prompt_pwd) +end diff --git a/themes/uggedal/fish_right_prompt.fish b/themes/uggedal/fish_right_prompt.fish new file mode 100644 index 0000000..b86c43c --- /dev/null +++ b/themes/uggedal/fish_right_prompt.fish @@ -0,0 +1,9 @@ +function fish_right_prompt + set -l last_status $status + + if test $last_status -ne 0 + set_color red + printf '%d' $last_status + set_color normal + end +end