changeset 226:210c011ffd52

Add Fish shell config.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 30 Sep 2014 07:40:31 -0700
parents facdcef5aa67
children 42c80ed36c2c
files fish/config.fish install.sh
diffstat 2 files changed, 143 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fish/config.fish	Tue Sep 30 07:40:31 2014 -0700
@@ -0,0 +1,138 @@
+
+# Environment variables {{{
+
+set -g -x fish_greeting 'Hello.'
+
+set -g -x PATH /usr/local/Cellar/ruby/1.9.3-p327/bin $PATH
+set -g -x PATH /usr/local/share/python $PATH
+set -g -x PATH /usr/local/sbin $PATH
+set -g -x PATH /usr/local/bin $PATH
+set -g -x PATH $HOME/bin $PATH
+
+set -g -x VIRTUAL_ENV_DISABLE_PROMPT 1
+
+set -g -x OS MacOSX
+
+set -g -x EDITOR vim
+
+# }}}
+
+# Aliases {{{
+
+alias tm 'tmux -u2'
+alias c 'clear'
+alias hl 'less -R'
+alias paththis 'set PATH (pwd) $PATH'
+
+alias h 'hg'
+alias g 'git'
+
+alias pbc 'pbcopy'
+alias pbp 'pbpaste'
+
+alias v 'vim'
+alias V 'vim .'
+
+alias vu 'vagrant up'
+alias vs 'vagrant suspend'
+
+alias o 'open'
+alias oo 'open .'
+
+# }}}
+
+# Prompt {{{
+
+set normal (set_color normal)
+set magenta (set_color magenta)
+set yellow (set_color yellow)
+set green (set_color green)
+set gray (set_color -o black)
+set hg_promptstring "< on $magenta<branch>$normal>< at $yellow<tags|$normal, $yellow>$normal>$green<status|modified|unknown><update>$normal<
+patches: <patches|join( → )|pre_applied($yellow)|post_applied($normal)|pre_unapplied($gray)|post_unapplied($normal)>>" 2>/dev/null
+
+function virtualenv_prompt
+    if [ -n "$VIRTUAL_ENV" ]
+        printf '(%s) ' (basename "$VIRTUAL_ENV")
+    end
+end
+
+function hg_prompt
+    if hg root >/dev/null 2>&1
+        set_color normal
+        printf ' on '
+        set_color magenta
+        printf '%s' (hg branch)
+        set_color normal
+    end
+end
+
+function git_prompt
+    if git root >/dev/null 2>&1
+        set_color normal
+        printf ' on '
+        set_color magenta
+        printf '%s' (git currentbranch ^/dev/null)
+        set_color green
+        git_prompt_status
+        set_color normal
+    end
+end
+
+function fish_prompt
+    set last_status $status
+
+    echo
+
+    set_color magenta
+    printf '%s' (whoami)
+    set_color normal
+    printf ' at '
+
+    set_color yellow
+    printf '%s' (hostname|cut -d . -f 1)
+    set_color normal
+    printf ' in '
+
+    set_color $fish_color_cwd
+    printf '%s' (prompt_pwd)
+    set_color normal
+
+    hg_prompt
+
+    echo
+
+    virtualenv_prompt
+
+    if test $last_status -eq 0
+        set_color white -o
+        printf '> '
+    else
+        set_color red -o
+        printf '[%d] > ' $last_status
+    end
+
+    set_color normal
+end
+
+# }}}
+
+# Directories {{{
+
+alias ..    'cd ..'
+alias ...   'cd ../..'
+alias ....  'cd ../../..'
+alias ..... 'cd ../../../..'
+
+alias md 'mkdir -p'
+
+# }}}
+
+# Local Settings {{{
+
+if test -s $HOME/.config/fish/local.fish
+    . $HOME/.config/fish/local.fish
+end
+
+# }}}
+
--- a/install.sh	Thu Sep 18 20:53:53 2014 -0700
+++ b/install.sh	Tue Sep 30 07:40:31 2014 -0700
@@ -7,6 +7,11 @@
 ln -s "$CWD/bashrc/bashrc" "$HOME/.bashrc"
 ln -s "$CWD/bashrc/bash_profile" "$HOME/.bash_profile"
 
+# FISH
+# ----
+mkdir -p $HOME/.config/fish/
+ln -s "$CWD/fish/config.fish" "$HOME/.config/fish/config.fish"
+
 # VIM
 # ---
 echo set runtimepath+=$CWD/vim > "$HOME/.vimrc"