Alpha Chen 1 year ago committed by Alpha Chen
parent adb619704d
commit 5c6b37166a
Signed by: alpha
SSH Key Fingerprint: SHA256:3fOT8fiYQG/aK9ntivV3Bqtg8AYQ7q4nV6ZgihOA20g

@ -34,34 +34,35 @@ bindkey "\en" history-beginning-search-forward
alias be='bundle exec' alias be='bundle exec'
alias tat='tmux new-session -As `basename $PWD | ruby -e "puts ARGF.read.strip.downcase.gsub(/[^\w]+/, ?-)"`' alias tat='tmux new-session -As `basename $PWD | ruby -e "puts ARGF.read.strip.downcase.gsub(/[^\w]+/, ?-)"`'
alias plz=sudo alias plz=sudo
alias ls=exa
alias emacs="emacs --no-window" alias emacs="emacs --no-window"
alias tmux="direnv exec / tmux" alias tmux="direnv exec / tmux"
alias ,df="git --git-dir=$HOME/.dotfiles.git --work-tree=$HOME"
function eject { command hdiutil eject `df | grep Volumes | grep -i "$@" | ruby -ne 'puts $_[/^[^ ]*/]'`; } function eject { command hdiutil eject `df | grep Volumes | grep -i "$@" | ruby -ne 'puts $_[/^[^ ]*/]'`; }
eval "$(brew shellenv)" # allow for pasting commands from the interwebs with a preceding $ prompt
function \$() { "$@" }
if [ -e $HOMEBREW_PREFIX/opt/fzf/shell/completion.zsh ]; then if [ -e $HOMEBREW_PREFIX/share/z.lua/z.lua ]; then
source $HOMEBREW_PREFIX/opt/fzf/shell/key-bindings.zsh eval "$(lua $HOMEBREW_PREFIX/share/z.lua/z.lua --init zsh enhanced fzf)"
source $HOMEBREW_PREFIX/opt/fzf/shell/completion.zsh
fi fi
[ -x "$(command -v kubectl)" ] && source <(kubectl completion zsh) if [ $commands[exa] ]; then
alias ls=exa
if [ -x "$(command -v terraform)" ]; then export EXA_COLORS="di=34"
autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /opt/homebrew/bin/terraform terraform
fi fi
if [ -e $HOMEBREW_PREFIX/share/z.lua/z.lua ]; then if [ $commands[bat] ]; then
eval "$(lua $HOMEBREW_PREFIX/share/z.lua/z.lua --init zsh enhanced fzf)" export BAT_THEME="ashes"
fi fi
### homebrew
eval "$(brew shellenv)"
### fzf
if [ $commands[fzf] ]; then if [ $commands[fzf] ]; then
[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.zsh" 2> /dev/null [[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.zsh" 2> /dev/null
source "/opt/homebrew/opt/fzf/shell/key-bindings.zsh"
export FZF_DEFAULT_OPTS="--height 40% --layout=reverse --border" export FZF_DEFAULT_OPTS="--height 40% --layout=reverse --border"
export FZF_DEFAULT_COMMAND="fd --type f --strip-cwd-prefix --hidden --follow --exclude .git" export FZF_DEFAULT_COMMAND="fd --type f --strip-cwd-prefix --hidden --follow --exclude .git"
@ -77,6 +78,9 @@ if [ $commands[fzf] ]; then
# ^gb is eaten by tmux # ^gb is eaten by tmux
eval "bindkey '^gg' fzf-git-branches-widget" eval "bindkey '^gg' fzf-git-branches-widget"
# I don't know why ^gl doesn't work - is it because ^l is eaten by tmux?
eval "bindkey '^gr' fzf-git-lreflogs-widget"
# https://github.com/skywind3000/z.lua/wiki/Effective-with-fzf#define-a-new-z--i # https://github.com/skywind3000/z.lua/wiki/Effective-with-fzf#define-a-new-z--i
zlua_fzf() { zlua_fzf() {
local dir local dir
@ -85,12 +89,18 @@ if [ $commands[fzf] ]; then
alias j=zlua_fzf # override prezto's fasd integration alias j=zlua_fzf # override prezto's fasd integration
fi fi
if [ $commands[exa] ]; then ### completions
export EXA_COLORS="di=34"
if [ -e $HOMEBREW_PREFIX/opt/fzf/shell/completion.zsh ]; then
source $HOMEBREW_PREFIX/opt/fzf/shell/key-bindings.zsh
source $HOMEBREW_PREFIX/opt/fzf/shell/completion.zsh
fi fi
if [ $commands[bat] ]; then [ -x "$(command -v kubectl)" ] && source <(kubectl completion zsh)
export BAT_THEME="ashes"
if [ -x "$(command -v terraform)" ]; then
autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /opt/homebrew/bin/terraform terraform
fi fi
# https://docs.brew.sh/Shell-Completion # https://docs.brew.sh/Shell-Completion
@ -102,7 +112,6 @@ then
compinit compinit
fi fi
# allow for pasting commands from the interwebs with a preceding $ prompt ### local overrides
function \$() { "$@" }
[[ -s "$HOME/.zshrc.local" ]] && . "$HOME/.zshrc.local" [[ -s "$HOME/.zshrc.local" ]] && . "$HOME/.zshrc.local"

Loading…
Cancel
Save