Mercurial > dotfiles
annotate fish/config.fish @ 243:ca28da5162f4
Hack Feedbin
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 06 Jan 2015 17:14:21 -0800 |
parents | e869b2f99c75 |
children | 9ea1d601383e |
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 | |
55 if [ -n "$VIRTUAL_ENV" ] | |
56 printf '(%s) ' (basename "$VIRTUAL_ENV") | |
57 end | |
58 end | |
59 | |
60 function hg_prompt | |
241
e869b2f99c75
Start using `hg-prompt`.
Ludovic Chabant <ludovic@chabant.com>
parents:
226
diff
changeset
|
61 hg prompt --angle-brackets $hg_promptstring 2>/dev/null |
226 | 62 end |
63 | |
64 function git_prompt | |
65 if git root >/dev/null 2>&1 | |
66 set_color normal | |
67 printf ' on ' | |
68 set_color magenta | |
69 printf '%s' (git currentbranch ^/dev/null) | |
70 set_color green | |
71 git_prompt_status | |
72 set_color normal | |
73 end | |
74 end | |
75 | |
76 function fish_prompt | |
77 set last_status $status | |
78 | |
79 echo | |
80 | |
81 set_color magenta | |
82 printf '%s' (whoami) | |
83 set_color normal | |
84 printf ' at ' | |
85 | |
86 set_color yellow | |
87 printf '%s' (hostname|cut -d . -f 1) | |
88 set_color normal | |
89 printf ' in ' | |
90 | |
91 set_color $fish_color_cwd | |
92 printf '%s' (prompt_pwd) | |
93 set_color normal | |
94 | |
95 hg_prompt | |
96 | |
97 echo | |
98 | |
99 virtualenv_prompt | |
100 | |
101 if test $last_status -eq 0 | |
102 set_color white -o | |
103 printf '> ' | |
104 else | |
105 set_color red -o | |
106 printf '[%d] > ' $last_status | |
107 end | |
108 | |
109 set_color normal | |
110 end | |
111 | |
112 # }}} | |
113 | |
114 # Directories {{{ | |
115 | |
116 alias .. 'cd ..' | |
117 alias ... 'cd ../..' | |
118 alias .... 'cd ../../..' | |
119 alias ..... 'cd ../../../..' | |
120 | |
121 alias md 'mkdir -p' | |
122 | |
123 # }}} | |
124 | |
125 # Local Settings {{{ | |
126 | |
127 if test -s $HOME/.config/fish/local.fish | |
128 . $HOME/.config/fish/local.fish | |
129 end | |
130 | |
131 # }}} | |
132 |