Mercurial > dotfiles
diff 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 |
line wrap: on
line diff
--- a/fish/config.fish Tue Mar 27 21:34:25 2018 -0700 +++ b/fish/config.fish Wed Mar 28 20:07:21 2018 -0700 @@ -1,37 +1,33 @@ # Environment variables {{{ -set -g -x fish_greeting 'Hello.' +set -x fish_greeting 'Hello.' -# Homebrew. -#set -g -x PATH /usr/local/sbin $PATH -#set -g -x PATH /usr/local/bin $PATH - # My own stuff. if test -d $HOME/.local/bin - set -g -x PATH $HOME/.local/bin $PATH + set -x PATH $HOME/.local/bin $PATH end if test -d $HOME/bin - set -g -x PATH $HOME/bin $PATH + set -x PATH $HOME/bin $PATH end -set -g -x OS MacOSX -set -g -x EDITOR vim -set -g -x TERM screen-256color-bce +set -x OS MacOSX +set -x EDITOR vim +#set -x TERM screen-256color-bce # Python. -set -g -x VIRTUAL_ENV_DISABLE_PROMPT 1 +set -x VIRTUAL_ENV_DISABLE_PROMPT 1 -# Go. -set -g -x GOPATH /usr/local/Cellar/go/1.4/gocode - +# Detect Git/Hg availability. if type -q git - set -g -x __local_has_git + set -x __local_has_git end if type -q hg - set -g -x __local_has_hg + set -x __local_has_hg end + +# Detect my own stuff. if test -e $HOME/.local/bin/fast-hg-bookmark - set -g -x __local_has_fast_hg_bookmark + set -x __local_has_fast_hg_bookmark end # }}} @@ -41,6 +37,19 @@ # Run Tmux in UTF8 and 256 colours always. alias tm 'tmux -u2' +# Switch directories. +alias .. 'cd ..' +alias ... 'cd ../..' +alias .... 'cd ../../..' +alias ..... 'cd ../../../..' + +alias md 'mkdir -p' + +# }}} + +# Key Bindings {{{ + + # }}} # Prompt {{{ @@ -137,14 +146,44 @@ # }}} -# Directories {{{ +# FZF {{{ -alias .. 'cd ..' -alias ... 'cd ../..' -alias .... 'cd ../../..' -alias ..... 'cd ../../../..' +if type -q fzf + function _gen_fzf_default_opts + set -l base03 "234" + set -l base02 "235" + set -l base01 "240" + set -l base00 "241" + set -l base0 "244" + set -l base1 "245" + set -l base2 "254" + set -l base3 "230" + set -l yellow "136" + set -l orange "166" + set -l red "160" + set -l magenta "125" + set -l violet "61" + set -l blue "33" + set -l cyan "37" + set -l green "64" -alias md 'mkdir -p' + # Solarized Dark color scheme for fzf + 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" + # Solarized Light color scheme for fzf + #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" + end + + _gen_fzf_default_opts + + if type -q ag + # Use Ag for searching. + set -x FZF_DEFAULT_COMMAND 'ag --nocolor -g ""' + end + + # Use the default command for searching in Fisherman's FZF plugin. + set -x FZF_FIND_FILE_COMMAND $FZF_DEFAULT_COMMAND + set -U FZF_LEGACY_KEYBINDINGS 0 +end # }}}