Skip to content

Instantly share code, notes, and snippets.

@nicman23
Last active August 22, 2021 17:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicman23/fb4b8c067048571e94e7ac8f4b2499be to your computer and use it in GitHub Desktop.
Save nicman23/fb4b8c067048571e94e7ac8f4b2499be to your computer and use it in GitHub Desktop.
zshrc just works (TM) +ssh agent
. ~/.antigen/init.zsh || eval "$(curl -L git.io/antigen)"
antigen use oh-my-zsh
antigen bundle git
antigen bundle heroku
antigen bundle pip
antigen bundle lein
antigen bundle command-not-found
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-completions
antigen theme gnzh
antigen apply
antigen () {
local MATCH MBEGIN MEND
[[ "$ZSH_EVAL_CONTEXT" =~ "toplevel:*" || "$ZSH_EVAL_CONTEXT" =~ "cmdarg:*" ]] && eval "$(curl -L git.io/antigen)" && eval antigen $@
return 0
}
zstyle ':completion:*' rehash true
zstyle ':compinstall' filename '$HOME/.zshrc'
zcachedir="$HOME/.zcache"
[[ -d "$zcachedir" ]] || mkdir -p "$zcachedir"
_update_zcomp() {
setopt local_options
setopt extendedglob
autoload -Uz compinit
local zcompf="$1/zcompdump"
local zcompf_a="${zcompf}.augur"
if [[ -e "$zcompf_a" && -f "$zcompf_a"(#qN.md-1) ]]; then
compinit -C -d "$zcompf"
else
compinit -d "$zcompf"
touch "$zcompf_a"
fi
if [[ -s "$zcompf" && (! -s "${zcompf}.zwc" || "$zcompf" -nt "${zcompf}.zwc") ]]; then
[[ -e "$zcompf.zwc" ]] && mv -f "$zcompf.zwc" "$zcompf.zwc.old"
zcompile -M "$zcompf" &!
fi
}
_update_zcomp "$zcachedir"
unfunction _update_zcomp
if [[ "$SSH_AGENT_PID" == "" ]] && [ -z "$SSH_TTY" ]
then
if [ -z "$(pgrep -u "$(whoami)" ssh-agent)" ]
then ssh-agent > ~/.ssh-agent-thing
fi
source <(grep -v echo ~/.ssh-agent-thing)
fi
export PATH="$HOME/.local/bin:$PATH:"
export EDITOR=nano
alias clear='/usr/bin/clear; echo -ne "\e[3J"'
alias duh='du -h'
resize() {
old=$(stty -g)
stty -echo
printf '\033[18t'
IFS=';' read -d t _ rows cols _
stty "$old"
stty cols "$cols" rows "$rows"
}
function upld() {
out="$(curl --upload-file - "https://transfer.sh/$1" 2> /dev/null)"
echo -e "\n\n"$out
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment