comparison fish/config.fish @ 226:210c011ffd52

Add Fish shell config.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 30 Sep 2014 07:40:31 -0700
parents
children e869b2f99c75
comparison
equal deleted inserted replaced
225:facdcef5aa67 226:210c011ffd52
1
2 # Environment variables {{{
3
4 set -g -x fish_greeting 'Hello.'
5
6 set -g -x PATH /usr/local/Cellar/ruby/1.9.3-p327/bin $PATH
7 set -g -x PATH /usr/local/share/python $PATH
8 set -g -x PATH /usr/local/sbin $PATH
9 set -g -x PATH /usr/local/bin $PATH
10 set -g -x PATH $HOME/bin $PATH
11
12 set -g -x VIRTUAL_ENV_DISABLE_PROMPT 1
13
14 set -g -x OS MacOSX
15
16 set -g -x EDITOR vim
17
18 # }}}
19
20 # Aliases {{{
21
22 alias tm 'tmux -u2'
23 alias c 'clear'
24 alias hl 'less -R'
25 alias paththis 'set PATH (pwd) $PATH'
26
27 alias h 'hg'
28 alias g 'git'
29
30 alias pbc 'pbcopy'
31 alias pbp 'pbpaste'
32
33 alias v 'vim'
34 alias V 'vim .'
35
36 alias vu 'vagrant up'
37 alias vs 'vagrant suspend'
38
39 alias o 'open'
40 alias oo 'open .'
41
42 # }}}
43
44 # Prompt {{{
45
46 set normal (set_color normal)
47 set magenta (set_color magenta)
48 set yellow (set_color yellow)
49 set green (set_color green)
50 set gray (set_color -o black)
51 set hg_promptstring "< on $magenta<branch>$normal>< at $yellow<tags|$normal, $yellow>$normal>$green<status|modified|unknown><update>$normal<
52 patches: <patches|join( → )|pre_applied($yellow)|post_applied($normal)|pre_unapplied($gray)|post_unapplied($normal)>>" 2>/dev/null
53
54 function virtualenv_prompt
55 if [ -n "$VIRTUAL_ENV" ]
56 printf '(%s) ' (basename "$VIRTUAL_ENV")
57 end
58 end
59
60 function hg_prompt
61 if hg root >/dev/null 2>&1
62 set_color normal
63 printf ' on '
64 set_color magenta
65 printf '%s' (hg branch)
66 set_color normal
67 end
68 end
69
70 function git_prompt
71 if git root >/dev/null 2>&1
72 set_color normal
73 printf ' on '
74 set_color magenta
75 printf '%s' (git currentbranch ^/dev/null)
76 set_color green
77 git_prompt_status
78 set_color normal
79 end
80 end
81
82 function fish_prompt
83 set last_status $status
84
85 echo
86
87 set_color magenta
88 printf '%s' (whoami)
89 set_color normal
90 printf ' at '
91
92 set_color yellow
93 printf '%s' (hostname|cut -d . -f 1)
94 set_color normal
95 printf ' in '
96
97 set_color $fish_color_cwd
98 printf '%s' (prompt_pwd)
99 set_color normal
100
101 hg_prompt
102
103 echo
104
105 virtualenv_prompt
106
107 if test $last_status -eq 0
108 set_color white -o
109 printf '> '
110 else
111 set_color red -o
112 printf '[%d] > ' $last_status
113 end
114
115 set_color normal
116 end
117
118 # }}}
119
120 # Directories {{{
121
122 alias .. 'cd ..'
123 alias ... 'cd ../..'
124 alias .... 'cd ../../..'
125 alias ..... 'cd ../../../..'
126
127 alias md 'mkdir -p'
128
129 # }}}
130
131 # Local Settings {{{
132
133 if test -s $HOME/.config/fish/local.fish
134 . $HOME/.config/fish/local.fish
135 end
136
137 # }}}
138