# HG changeset patch # User Ludovic Chabant # Date 1412088031 25200 # Node ID 210c011ffd52b4bfef3d7a8d2dc198b0feec8411 # Parent facdcef5aa67b3bc7132cac67628dbfc0167b20d Add Fish shell config. diff -r facdcef5aa67 -r 210c011ffd52 fish/config.fish --- /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$normal>< at $yellow$normal>$green$normal< +patches: >" 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 + +# }}} + diff -r facdcef5aa67 -r 210c011ffd52 install.sh --- 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"