Mercurial > dotfiles
annotate fish/config.fish @ 344:2d5974d70482
Move hg-git sync script to its own subrepo.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 18 Feb 2016 17:08:53 -0800 |
parents | 1542a1b041fc |
children | adfa6bb4c20e |
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 | |
311 | 14 set -g -x GOPATH /usr/local/Cellar/go/1.4/gocode |
15 | |
226 | 16 set -g -x OS MacOSX |
17 | |
18 set -g -x EDITOR vim | |
19 | |
20 # }}} | |
21 | |
22 # Aliases {{{ | |
23 | |
24 alias tm 'tmux -u2' | |
25 alias c 'clear' | |
26 alias hl 'less -R' | |
27 alias paththis 'set PATH (pwd) $PATH' | |
28 | |
29 alias h 'hg' | |
30 alias g 'git' | |
31 | |
32 alias pbc 'pbcopy' | |
33 alias pbp 'pbpaste' | |
34 | |
35 alias v 'vim' | |
36 alias V 'vim .' | |
37 | |
38 alias vu 'vagrant up' | |
39 alias vs 'vagrant suspend' | |
40 | |
41 alias o 'open' | |
42 alias oo 'open .' | |
43 | |
44 # }}} | |
45 | |
46 # Prompt {{{ | |
47 | |
48 set normal (set_color normal) | |
49 set magenta (set_color magenta) | |
50 set yellow (set_color yellow) | |
51 set green (set_color green) | |
52 set gray (set_color -o black) | |
53 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
|
54 patches: <patches|join( → )|pre_applied($yellow)|post_applied($normal)|pre_unapplied($gray)|post_unapplied($normal)>>" 2>/dev/null |
226 | 55 |
56 function virtualenv_prompt | |
254
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
57 #if [ -n "$VIRTUAL_ENV" ] |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
58 # printf '(%s) ' (basename "$VIRTUAL_ENV") |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
59 #end |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
60 if set -q VIRTUAL_ENV |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
61 set_color -b blue white |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
62 printf '(%s)' (basename "$VIRTUAL_ENV") |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
63 set_color normal |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
64 printf ' ' |
226 | 65 end |
66 end | |
67 | |
68 function hg_prompt | |
241
e869b2f99c75
Start using `hg-prompt`.
Ludovic Chabant <ludovic@chabant.com>
parents:
226
diff
changeset
|
69 hg prompt --angle-brackets $hg_promptstring 2>/dev/null |
226 | 70 end |
71 | |
72 function git_prompt | |
73 if git root >/dev/null 2>&1 | |
74 set_color normal | |
75 printf ' on ' | |
76 set_color magenta | |
77 printf '%s' (git currentbranch ^/dev/null) | |
78 set_color green | |
79 git_prompt_status | |
80 set_color normal | |
81 end | |
82 end | |
83 | |
84 function fish_prompt | |
85 set last_status $status | |
86 | |
87 echo | |
88 | |
89 set_color magenta | |
90 printf '%s' (whoami) | |
91 set_color normal | |
92 printf ' at ' | |
93 | |
94 set_color yellow | |
95 printf '%s' (hostname|cut -d . -f 1) | |
96 set_color normal | |
97 printf ' in ' | |
98 | |
99 set_color $fish_color_cwd | |
100 printf '%s' (prompt_pwd) | |
101 set_color normal | |
102 | |
103 hg_prompt | |
104 | |
105 echo | |
106 | |
107 virtualenv_prompt | |
108 | |
109 if test $last_status -eq 0 | |
110 set_color white -o | |
111 printf '> ' | |
112 else | |
113 set_color red -o | |
114 printf '[%d] > ' $last_status | |
115 end | |
116 | |
117 set_color normal | |
118 end | |
119 | |
120 # }}} | |
121 | |
122 # Directories {{{ | |
123 | |
124 alias .. 'cd ..' | |
125 alias ... 'cd ../..' | |
126 alias .... 'cd ../../..' | |
127 alias ..... 'cd ../../../..' | |
128 | |
129 alias md 'mkdir -p' | |
130 | |
131 # }}} | |
132 | |
254
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
133 # Virtualenv wrapper for Fish {{{ |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
134 |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
135 #set -g VIRTUALFISH_COMPAT_ALIASES # uncomment for virtualenvwrapper-style commands |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
136 . $HOME/.config/fish/virtualfish/virtual.fish |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
137 # optional plugins |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
138 #. path/to/auto_activation.fish |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
139 #. path/to/global_requirements.fish |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
140 #. path/to/projects.fish |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
141 |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
142 # }}} |
9ea1d601383e
Virtualenv wrapper for Fish.
Ludovic Chabant <ludovic@chabant.com>
parents:
241
diff
changeset
|
143 |
226 | 144 # Local Settings {{{ |
145 | |
146 if test -s $HOME/.config/fish/local.fish | |
147 . $HOME/.config/fish/local.fish | |
148 end | |
149 | |
150 # }}} | |
151 |