Mercurial > dotfiles
annotate fish/config.fish @ 280:6eb4ceca4d99
Ignore pyc files.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 27 Jan 2015 15:31:38 -0800 |
parents | 9ea1d601383e |
children | 1542a1b041fc |
rev | line source |
---|---|
226 | 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< | |
241
e869b2f99c75
Start using `hg-prompt`.
Ludovic Chabant <ludovic@chabant.com>
parents:
226
diff
changeset
|
52 patches: <patches|join( → )|pre_applied($yellow)|post_applied($normal)|pre_unapplied($gray)|post_unapplied($normal)>>" 2>/dev/null |
226 | 53 |
54 function virtualenv_prompt | |
254
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
55 #if [ -n "$VIRTUAL_ENV" ] |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
56 # printf '(%s) ' (basename "$VIRTUAL_ENV") |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
57 #end |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
58 if set -q VIRTUAL_ENV |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
59 set_color -b blue white |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
60 printf '(%s)' (basename "$VIRTUAL_ENV") |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
61 set_color normal |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
62 printf ' ' |
226 | 63 end |
64 end | |
65 | |
66 function hg_prompt | |
241
e869b2f99c75
Start using `hg-prompt`.
Ludovic Chabant <ludovic@chabant.com>
parents:
226
diff
changeset
|
67 hg prompt --angle-brackets $hg_promptstring 2>/dev/null |
226 | 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 | |
254
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
131 # Virtualenv wrapper for Fish {{{ |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
132 |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
133 #set -g VIRTUALFISH_COMPAT_ALIASES # uncomment for virtualenvwrapper-style commands |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
134 . $HOME/.config/fish/virtualfish/virtual.fish |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
135 # optional plugins |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
136 #. path/to/auto_activation.fish |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
137 #. path/to/global_requirements.fish |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
138 #. path/to/projects.fish |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
139 |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
140 # }}} |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
141 |
226 | 142 # Local Settings {{{ |
143 | |
144 if test -s $HOME/.config/fish/local.fish | |
145 . $HOME/.config/fish/local.fish | |
146 end | |
147 | |
148 # }}} | |
149 |