Permalink
Browse files

fisssssh

  • Loading branch information...
1 parent 3156604 commit 5635c4a0402682cce0b361d3b0d869c2c47c8313 @mattly committed Jun 16, 2012
Showing with 74 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +72 −0 config/fish/config.fish
View
@@ -1,3 +1,5 @@
+config/fish/fish_history
+config/fish/fishd*
vim/session
vim/.netrwhist
vim/bundle/*/doc/*
View
@@ -0,0 +1,72 @@
+# -- PATH
+if status --is-login
+ function unshift_path
+ if test -d $arg
+ set -xg PATH $arg $PATH
+ end
+ end
+
+ unshift_path /bin /sbin
+ unshift_path /usr/bin /usr/sbin
+ unshift_path /usr/local/bin /usr/local/sbin
+
+ unshift_path $HOME/bin
+ unshift_path $HOME/.rbenv/bin
+end
+
+# -- ENV
+set -xg EDITOR "vim"
+set -xg BROWSER "open"
+
+# -- HOST SPECIFIC
+if test -e "$HOME/.env"
+ . ~/.env
+end
+
+# -- PROMPT AWESOME
+function fish_prompt -d "Write out the prompt"
+ set -l exit_status $status
+
+ printf "\n"
+ printf '%s@%s' (whoami) (hostname|cut -d . -f 1)
+ printf ':%s' (prompt_pwd)
+
+ set -l git_status (git status 2> /dev/null)
+ if test $git_status[1]
+ printf ' %s±%s' (set_color blue) (set_color normal)
+ if echo $git_status[1] | grep "Not currently on any branch." >/dev/null
+ printf 'no-branch'
+ else
+ printf '%s' (echo $git_status[1] | awk ' { print $4 } ')
+ end
+ if echo $git_status[2] | grep "Your branch is" >/dev/null
+ switch (echo $git_status[2] | awk ' { print $5 } ')
+ case 'ahead'
+ printf "%s↑%s" (set_color cyan) (set_color normal)
+ case 'diverged'
+ printf "%s↕%s" (set_color magenta) (set_color normal)
+ case 'behind'
+ printf "%s↓%s" (set_color green) (set_color normal)
+ case '*'
+ printf '::%s' (echo $git_status[2] | awk ' { print $5 } ' )
+ end
+ end
+ if echo $git_status | grep "nothing to commit" >/dev/null
+ else
+ printf '%s⚡%s' (set_color red) (set_color normal)
+ end
+ end
+
+ if test $exit_status -eq 0
+ printf ' %s:\)' (set_color green)
+ else
+ printf ' %s:\(E%s' (set_color red) $exit_status
+ end
+
+ printf '%s ' (set_color normal)
+end
+
+# -- DISH THE FISH
+set fish_greeting ""
+set -x CLICOLOR 1
+

0 comments on commit 5635c4a

Please sign in to comment.