Skip to content

Instantly share code, notes, and snippets.

@fervic
Last active May 3, 2018 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fervic/bf39278e04972f173ef54bcc80bd10d9 to your computer and use it in GitHub Desktop.
Save fervic/bf39278e04972f173ef54bcc80bd10d9 to your computer and use it in GitHub Desktop.
.zshrc
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory autocd
unsetopt beep extendedglob nomatch notify
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall (but then updated for speed)
zstyle :compinstall filename '/home/rfernandez/.zshrc'
autoload -Uz compinit
# https://gist.github.com/ctechols/ca1035271ad134841284
for dump in ~/.zcompdump(N.mh+24); do
compinit
done
compinit -C
# End of lines added by compinstall
# Persistent rehash
zstyle ':completion:*' rehash true
# Fish-like syntax highlighting
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# zplug and plugins
source /usr/share/zsh/scripts/zplug/init.zsh
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-history-substring-search"
zplug "plugins/common-aliases", from:oh-my-zsh
zplug "plugins/aws", from:oh-my-zsh
zplug "plugins/jsontools", from:oh-my-zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/golang", from:oh-my-zsh
zplug "plugins/thefuck", from:oh-my-zsh
zplug "plugins/shrink-path", from:oh-my-zsh
zplug "plugins/wd", from:oh-my-zsh
# Theme
zplug "fervic/ba13cacc0042387a413c", \
from:gist, \
as:theme
# Manage zplug itself like other packages
zplug 'zplug/zplug', hook-build:'zplug --self-manage'
# Install plugins if there are plugins that have not been installed
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
# Then, source plugins and add commands to $PATH
zplug load
# History substring search keybindings
bindkey '' history-substring-search-up
bindkey '' history-substring-search-down
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
bindkey '' delete-char
bindkey '[3~' delete-char
# Aliases
alias ls='ls --color=auto'
alias calc='bc -l'
# Refresh gpg-agent tty in case user switches into an X session
gpg-connect-agent updatestartuptty /bye > /dev/null
# Set the window title to current working directory
chpwd() { print -Pn "\033]2;$(shrink_path -f)\a" }
# Set the window title to a VIM logo and cwd
# See https://github.com/jreese/zsh-titles/blob/master/titles.plugin.zsh for
# ideas on how to make it work
# print -Pn "\033]2; (%~)\a"
# Update master on git
gum () {
git checkout master &&
git fetch canonical &&
git reset --hard canonical/master &&
git push -u origin master
}
# Reset vendor/
gvr () {
rm -rf vendor &&
glide cc &&
glide install
}
# Set terminal window title then connect normally
sshx () {
echo -n "\033]2;$1\007" &&
ssh $1
}
compdef sshx=ssh
# This was added when installing fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment