2017-05-27 22:24:02 +02:00
|
|
|
export PATH=$HOME/bin:/opt/local/bin:/opt/local/sbin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/fzf/bin:$HOME/n/bin:$HOME/.cargo/bin
|
2016-08-15 17:14:37 +02:00
|
|
|
|
2017-06-05 02:30:08 +02:00
|
|
|
|
2018-01-08 21:40:47 +01:00
|
|
|
# export the path this repository
|
|
|
|
export PC_SETTINGS_PATH=$HOME/pc_settings
|
|
|
|
|
|
|
|
|
2017-01-17 23:50:33 +01:00
|
|
|
# use emacs bindings (default) for terminal input
|
|
|
|
set -o emacs
|
2016-05-04 20:11:38 +02:00
|
|
|
|
2017-06-13 17:33:16 +02:00
|
|
|
|
2018-01-08 21:40:47 +01:00
|
|
|
# Configure default editor
|
|
|
|
command -v nvim >/dev/null && \
|
|
|
|
export EDITOR=nvim || \
|
|
|
|
export EDITOR=vim
|
|
|
|
|
|
|
|
|
2017-07-30 03:36:25 +02:00
|
|
|
# iex and erl shared interactive shell history
|
|
|
|
export ERL_AFLAGS="-kernel shell_history enabled"
|
|
|
|
|
|
|
|
|
2018-01-08 21:40:47 +01:00
|
|
|
# drone env variables
|
|
|
|
export DRONE_SERVER="https://ci.urbinternal.com"
|
|
|
|
export DRONE_TOKEN=$(<"${PC_SETTINGS_PATH}/configs/secrets/drone_token.txt")
|
|
|
|
|
|
|
|
|
2016-08-15 17:14:37 +02:00
|
|
|
source $HOME/pc_settings/aliases.sh
|
|
|
|
source $HOME/pc_settings/functions/index.sh
|
|
|
|
source $HOME/pc_settings/scripts/setup_keybindings.sh
|
2017-06-13 17:33:16 +02:00
|
|
|
source $HOME/pc_settings/emacs/index.sh
|
|
|
|
|
2016-05-04 20:11:38 +02:00
|
|
|
|
|
|
|
bindkey "^R" history-incremental-search-backward
|
|
|
|
|
2016-06-28 04:59:20 +02:00
|
|
|
|
2016-05-04 20:11:38 +02:00
|
|
|
# export docker env variables
|
2016-06-24 19:34:33 +02:00
|
|
|
# re-enable this line when using docker otherwise you will receive
|
|
|
|
# a TLS error since docker-machine won't be running
|
|
|
|
# eval "$(docker-machine env default)"
|
2016-05-04 20:11:38 +02:00
|
|
|
|
2016-06-24 19:34:33 +02:00
|
|
|
# run cmatrix command for 3 seconds before exiting
|
2016-07-12 16:39:02 +02:00
|
|
|
#. $HOME/pc_settings/.matrix_intro.sh
|
2016-06-24 19:34:33 +02:00
|
|
|
|
|
|
|
# syntax highlighting for CLI; if not installed, run the following command
|
|
|
|
# brew install zsh-syntax-highlighting
|
|
|
|
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
|
|
|
2016-11-04 21:53:45 +01:00
|
|
|
# Regain control of CLI <C- mappings for vim keybindings
|
|
|
|
# RE: http://superuser.com/questions/588846/cannot-get-vim-to-remap-ctrls-to-w
|
|
|
|
stty -ixon
|
|
|
|
|
2016-12-04 22:39:59 +01:00
|
|
|
|
2017-05-22 17:33:24 +02:00
|
|
|
# Allows FZF to search hidden files (excluding .git repository)
|
|
|
|
export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -l -g ""'
|
|
|
|
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
|
|
|
|
2017-06-25 21:43:38 +02:00
|
|
|
|
2017-05-27 22:24:02 +02:00
|
|
|
# CTRL-Y - Paste the selected branch(es) into the command line
|
|
|
|
__bsel() {
|
|
|
|
local cmd="git branch -a | tr -d '* ' | sed 's/^remotes\/origin\///' | sort | uniq"
|
|
|
|
setopt localoptions pipefail 2> /dev/null
|
|
|
|
eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" $(__fzfcmd) -m "$@" | while read item; do
|
|
|
|
echo -n "${(q)item} "
|
|
|
|
done
|
|
|
|
local ret=$?
|
|
|
|
echo
|
|
|
|
return $ret
|
|
|
|
}
|
|
|
|
|
|
|
|
fzf-branch-widget() {
|
|
|
|
LBUFFER="${LBUFFER}$(__bsel)"
|
|
|
|
local ret=$?
|
|
|
|
zle redisplay
|
|
|
|
typeset -f zle-line-init >/dev/null && zle zle-line-init
|
|
|
|
return $ret
|
|
|
|
}
|
|
|
|
zle -N fzf-branch-widget
|
|
|
|
bindkey '^Y' fzf-branch-widget
|
|
|
|
|
2017-05-22 17:33:24 +02:00
|
|
|
|
2016-12-04 22:39:59 +01:00
|
|
|
# Run Autojump at shell startup
|
|
|
|
[[ $(brew --prefix)/etc/profile.d/autojump.sh ]] && \
|
|
|
|
. $(brew --prefix)/etc/profile.d/autojump.sh
|