view fish/config.fish @ 343:f5847cdffc21

Vimperator fixes and tweaks.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 01 Feb 2016 20:46:13 -0800
parents 1542a1b041fc
children adfa6bb4c20e
line wrap: on
line source


# 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 GOPATH /usr/local/Cellar/go/1.4/gocode

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
    if set -q VIRTUAL_ENV
        set_color -b blue white
        printf '(%s)' (basename "$VIRTUAL_ENV")
        set_color normal
        printf ' '
    end
end

function hg_prompt
    hg prompt --angle-brackets $hg_promptstring 2>/dev/null
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'

# }}}

# Virtualenv wrapper for Fish {{{

#set -g VIRTUALFISH_COMPAT_ALIASES # uncomment for virtualenvwrapper-style commands
. $HOME/.config/fish/virtualfish/virtual.fish
# optional plugins
#. path/to/auto_activation.fish
#. path/to/global_requirements.fish
#. path/to/projects.fish

# }}}

# Local Settings {{{

if test -s $HOME/.config/fish/local.fish
    . $HOME/.config/fish/local.fish
end

# }}}