comparison fish/config.fish @ 404:b5d54b669b8c

Improve fish config.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 12 Dec 2017 22:10:33 -0800
parents ff48d206d1f1
children c05a8f250042
comparison
equal deleted inserted replaced
403:aad209194477 404:b5d54b669b8c
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 # Homebrew. 6 # Homebrew.
7 set -g -x PATH /usr/local/sbin $PATH 7 #set -g -x PATH /usr/local/sbin $PATH
8 set -g -x PATH /usr/local/bin $PATH 8 #set -g -x PATH /usr/local/bin $PATH
9 9
10 # My own stuff. 10 # My own stuff.
11 set -g -x PATH $HOME/.local/bin $PATH 11 if test -d $HOME/.local/bin
12 set -g -x PATH $HOME/bin $PATH 12 set -g -x PATH $HOME/.local/bin $PATH
13 end
14 if test -d $HOME/bin
15 set -g -x PATH $HOME/bin $PATH
16 end
13 set -g -x OS MacOSX 17 set -g -x OS MacOSX
14 set -g -x EDITOR vim 18 set -g -x EDITOR vim
15 set -g -x SHELL fish 19 set -g -x SHELL fish
16 20
17 # Python. 21 # Python.
18 set -g -x VIRTUAL_ENV_DISABLE_PROMPT 1 22 set -g -x VIRTUAL_ENV_DISABLE_PROMPT 1
19 23
20 # Go. 24 # Go.
21 set -g -x GOPATH /usr/local/Cellar/go/1.4/gocode 25 set -g -x GOPATH /usr/local/Cellar/go/1.4/gocode
22 26
27 if type -q git
28 set -g -x __local_has_git
29 end
30 if type -q hg
31 set -g -x __local_has_hg
32 end
33
23 # }}} 34 # }}}
24 35
25 # Aliases {{{ 36 # Aliases {{{
26 37
38 # Run Tmux in UTF8 and 256 colours always.
27 alias tm 'tmux -u2' 39 alias tm 'tmux -u2'
28 40
29 # }}} 41 # }}}
30 42
31 # Prompt {{{ 43 # Prompt {{{
44 printf ' ' 56 printf ' '
45 end 57 end
46 end 58 end
47 59
48 function prompt_char 60 function prompt_char
49 if git branch >/dev/null 2>/dev/null 61 if set -q __local_has_git
50 printf '±' ; return 62 if git branch >/dev/null 2>/dev/null
63 printf '±' ; return
64 end
65 if hg root >/dev/null 2>/dev/null
66 printf '☿' ; return
67 end
68 echo '○'
51 end 69 end
52 if hg root >/dev/null 2>/dev/null
53 printf '☿' ; return
54 end
55 echo '○'
56 end 70 end
57 71
58 function hg_prompt 72 function hg_prompt
59 set_color magenta 73 if set -q __local_has_hg
60 printf '%s' (fast-hg-bookmark 2>/dev/null) 74 set_color magenta
61 set_color normal 75 printf '%s' (fast-hg-bookmark 2>/dev/null)
76 set_color normal
77 end
62 end 78 end
63 79
64 function git_prompt 80 function git_prompt
65 if git root >/dev/null 2>&1 81 if set -q __local_has_git
66 set_color normal 82 if git root >/dev/null 2>&1
67 printf ' on ' 83 set_color normal
68 set_color magenta 84 printf ' on '
69 printf '%s' (git currentbranch ^/dev/null) 85 set_color magenta
70 set_color green 86 printf '%s' (git currentbranch ^/dev/null)
71 git_prompt_status 87 set_color green
72 set_color normal 88 git_prompt_status
89 set_color normal
90 end
73 end 91 end
74 end 92 end
75 93
76 function fish_prompt 94 function fish_prompt
77 set last_status $status 95 set last_status $status
126 144
127 # }}} 145 # }}}
128 146
129 # Virtualenv wrapper for Fish {{{ 147 # Virtualenv wrapper for Fish {{{
130 148
131 eval (/usr/local/bin/python2.7 -m virtualfish) 149 #eval (python -m virtualfish)
132 150
133 #set -g VIRTUALFISH_COMPAT_ALIASES # uncomment for virtualenvwrapper-style commands 151 #set -g VIRTUALFISH_COMPAT_ALIASES # uncomment for virtualenvwrapper-style commands
134 #. $HOME/.config/fish/virtualfish/virtual.fish 152 #. $HOME/.config/fish/virtualfish/virtual.fish
135 # optional plugins 153 # optional plugins
136 #. path/to/auto_activation.fish 154 #. path/to/auto_activation.fish