comparison fish/config.fish @ 425:350f7a55ff33

Improve fish configuration.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 28 Mar 2018 20:07:21 -0700
parents 61f343a2aaff
children 9a046e8fe5dd
comparison
equal deleted inserted replaced
424:d8086f81b9c8 425:350f7a55ff33
1 1
2 # Environment variables {{{ 2 # Environment variables {{{
3 3
4 set -g -x fish_greeting 'Hello.' 4 set -x fish_greeting 'Hello.'
5 5
6 # Homebrew.
7 #set -g -x PATH /usr/local/sbin $PATH
8 #set -g -x PATH /usr/local/bin $PATH
9
10 # My own stuff. 6 # My own stuff.
11 if test -d $HOME/.local/bin 7 if test -d $HOME/.local/bin
12 set -g -x PATH $HOME/.local/bin $PATH 8 set -x PATH $HOME/.local/bin $PATH
13 end 9 end
14 if test -d $HOME/bin 10 if test -d $HOME/bin
15 set -g -x PATH $HOME/bin $PATH 11 set -x PATH $HOME/bin $PATH
16 end 12 end
17 set -g -x OS MacOSX 13 set -x OS MacOSX
18 set -g -x EDITOR vim 14 set -x EDITOR vim
19 set -g -x TERM screen-256color-bce 15 #set -x TERM screen-256color-bce
20 16
21 # Python. 17 # Python.
22 set -g -x VIRTUAL_ENV_DISABLE_PROMPT 1 18 set -x VIRTUAL_ENV_DISABLE_PROMPT 1
23 19
24 # Go. 20 # Detect Git/Hg availability.
25 set -g -x GOPATH /usr/local/Cellar/go/1.4/gocode
26
27 if type -q git 21 if type -q git
28 set -g -x __local_has_git 22 set -x __local_has_git
29 end 23 end
30 if type -q hg 24 if type -q hg
31 set -g -x __local_has_hg 25 set -x __local_has_hg
32 end 26 end
27
28 # Detect my own stuff.
33 if test -e $HOME/.local/bin/fast-hg-bookmark 29 if test -e $HOME/.local/bin/fast-hg-bookmark
34 set -g -x __local_has_fast_hg_bookmark 30 set -x __local_has_fast_hg_bookmark
35 end 31 end
36 32
37 # }}} 33 # }}}
38 34
39 # Aliases {{{ 35 # Aliases {{{
40 36
41 # Run Tmux in UTF8 and 256 colours always. 37 # Run Tmux in UTF8 and 256 colours always.
42 alias tm 'tmux -u2' 38 alias tm 'tmux -u2'
39
40 # Switch directories.
41 alias .. 'cd ..'
42 alias ... 'cd ../..'
43 alias .... 'cd ../../..'
44 alias ..... 'cd ../../../..'
45
46 alias md 'mkdir -p'
47
48 # }}}
49
50 # Key Bindings {{{
51
43 52
44 # }}} 53 # }}}
45 54
46 # Prompt {{{ 55 # Prompt {{{
47 56
135 set_color normal 144 set_color normal
136 end 145 end
137 146
138 # }}} 147 # }}}
139 148
140 # Directories {{{ 149 # FZF {{{
141 150
142 alias .. 'cd ..' 151 if type -q fzf
143 alias ... 'cd ../..' 152 function _gen_fzf_default_opts
144 alias .... 'cd ../../..' 153 set -l base03 "234"
145 alias ..... 'cd ../../../..' 154 set -l base02 "235"
155 set -l base01 "240"
156 set -l base00 "241"
157 set -l base0 "244"
158 set -l base1 "245"
159 set -l base2 "254"
160 set -l base3 "230"
161 set -l yellow "136"
162 set -l orange "166"
163 set -l red "160"
164 set -l magenta "125"
165 set -l violet "61"
166 set -l blue "33"
167 set -l cyan "37"
168 set -l green "64"
146 169
147 alias md 'mkdir -p' 170 # Solarized Dark color scheme for fzf
171 set -x FZF_DEFAULT_OPTS "--color fg:-1,bg:-1,hl:$blue,fg+:$base2,bg+:$base02,hl+:$blue --color info:$yellow,prompt:$yellow,pointer:$base3,marker:$base3,spinner:$yellow"
172 # Solarized Light color scheme for fzf
173 #set -x FZF_DEFAULT_OPTS "--color fg:-1,bg:-1,hl:$blue,fg+:$base02,bg+:$base2,hl+:$blue --color info:$yellow,prompt:$yellow,pointer:$base03,marker:$base03,spinner:$yellow"
174 end
175
176 _gen_fzf_default_opts
177
178 if type -q ag
179 # Use Ag for searching.
180 set -x FZF_DEFAULT_COMMAND 'ag --nocolor -g ""'
181 end
182
183 # Use the default command for searching in Fisherman's FZF plugin.
184 set -x FZF_FIND_FILE_COMMAND $FZF_DEFAULT_COMMAND
185 set -U FZF_LEGACY_KEYBINDINGS 0
186 end
148 187
149 # }}} 188 # }}}
150 189
151 # Local Settings {{{ 190 # Local Settings {{{
152 191