comparison fish/config.fish @ 350:adfa6bb4c20e

Cleanup of Fish config.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 29 Jul 2016 21:04:26 -0700
parents 1542a1b041fc
children 4963dd2dcefc
comparison
equal deleted inserted replaced
349:8d68547c3660 350:adfa6bb4c20e
1 1
2 # Environment variables {{{ 2 # Environment variables {{{
3 3
4 set -g -x fish_greeting 'Hello.' 4 set -g -x fish_greeting 'Hello.'
5 5
6 set -g -x PATH /usr/local/Cellar/ruby/1.9.3-p327/bin $PATH 6 # Homebrew.
7 set -g -x PATH /usr/local/share/python $PATH
8 set -g -x PATH /usr/local/sbin $PATH 7 set -g -x PATH /usr/local/sbin $PATH
9 set -g -x PATH /usr/local/bin $PATH 8 set -g -x PATH /usr/local/bin $PATH
9
10 # My own stuff.
10 set -g -x PATH $HOME/bin $PATH 11 set -g -x PATH $HOME/bin $PATH
12 set -g -x OS MacOSX
13 set -g -x EDITOR vim
11 14
15 # Python.
12 set -g -x VIRTUAL_ENV_DISABLE_PROMPT 1 16 set -g -x VIRTUAL_ENV_DISABLE_PROMPT 1
13 17
18 # Go.
14 set -g -x GOPATH /usr/local/Cellar/go/1.4/gocode 19 set -g -x GOPATH /usr/local/Cellar/go/1.4/gocode
15
16 set -g -x OS MacOSX
17
18 set -g -x EDITOR vim
19 20
20 # }}} 21 # }}}
21 22
22 # Aliases {{{ 23 # Aliases {{{
23 24
24 alias tm 'tmux -u2' 25 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 26
44 # }}} 27 # }}}
45 28
46 # Prompt {{{ 29 # Prompt {{{
47 30
48 set normal (set_color normal) 31 set normal (set_color normal)
49 set magenta (set_color magenta) 32 set magenta (set_color magenta)
50 set yellow (set_color yellow) 33 set yellow (set_color yellow)
51 set green (set_color green) 34 set green (set_color green)
52 set gray (set_color -o black) 35 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<
54 patches: <patches|join( → )|pre_applied($yellow)|post_applied($normal)|pre_unapplied($gray)|post_unapplied($normal)>>" 2>/dev/null
55 36
56 function virtualenv_prompt 37 function virtualenv_prompt
57 #if [ -n "$VIRTUAL_ENV" ]
58 # printf '(%s) ' (basename "$VIRTUAL_ENV")
59 #end
60 if set -q VIRTUAL_ENV 38 if set -q VIRTUAL_ENV
61 set_color -b blue white 39 set_color -b blue white
62 printf '(%s)' (basename "$VIRTUAL_ENV") 40 printf '(venv:%s)' (basename "$VIRTUAL_ENV")
63 set_color normal 41 set_color normal
64 printf ' ' 42 printf ' '
65 end 43 end
66 end 44 end
67 45
46 function prompt_char
47 if git branch >/dev/null 2>/dev/null
48 printf '±' ; return
49 end
50 if hg root >/dev/null 2>/dev/null
51 printf '☿' ; return
52 end
53 echo '○'
54 end
55
68 function hg_prompt 56 function hg_prompt
69 hg prompt --angle-brackets $hg_promptstring 2>/dev/null 57 set_color magenta
58 printf '%s' (fast-hg-bookmark 2>/dev/null)
59 set_color normal
70 end 60 end
71 61
72 function git_prompt 62 function git_prompt
73 if git root >/dev/null 2>&1 63 if git root >/dev/null 2>&1
74 set_color normal 64 set_color normal
84 function fish_prompt 74 function fish_prompt
85 set last_status $status 75 set last_status $status
86 76
87 echo 77 echo
88 78
79 # 'username@hostname: '
89 set_color magenta 80 set_color magenta
90 printf '%s' (whoami) 81 printf '%s' (whoami)
91 set_color normal 82 set_color normal
92 printf ' at ' 83 printf '@'
93
94 set_color yellow 84 set_color yellow
95 printf '%s' (hostname|cut -d . -f 1) 85 printf '%s' (hostname|cut -d . -f 1)
96 set_color normal 86 set_color normal
97 printf ' in ' 87 printf ': '
98 88
99 set_color $fish_color_cwd 89 set_color $fish_color_cwd
100 printf '%s' (prompt_pwd) 90 printf '%s' (prompt_pwd)
101 set_color normal 91 set_color normal
92
93 printf ' '
94 prompt_char
95 printf ' '
102 96
103 hg_prompt 97 hg_prompt
104 98
105 echo 99 echo
106 100
130 124
131 # }}} 125 # }}}
132 126
133 # Virtualenv wrapper for Fish {{{ 127 # Virtualenv wrapper for Fish {{{
134 128
129 eval (python -m virtualfish)
130
135 #set -g VIRTUALFISH_COMPAT_ALIASES # uncomment for virtualenvwrapper-style commands 131 #set -g VIRTUALFISH_COMPAT_ALIASES # uncomment for virtualenvwrapper-style commands
136 . $HOME/.config/fish/virtualfish/virtual.fish 132 #. $HOME/.config/fish/virtualfish/virtual.fish
137 # optional plugins 133 # optional plugins
138 #. path/to/auto_activation.fish 134 #. path/to/auto_activation.fish
139 #. path/to/global_requirements.fish 135 #. path/to/global_requirements.fish
140 #. path/to/projects.fish 136 #. path/to/projects.fish
141 137