Skip to content

Instantly share code, notes, and snippets.

@blpabhishek
Created September 16, 2018 17:19
Show Gist options
  • Save blpabhishek/657e6475ba39e9570809fb3225adc29c to your computer and use it in GitHub Desktop.
Save blpabhishek/657e6475ba39e9570809fb3225adc29c to your computer and use it in GitHub Desktop.
zshrc
export HOMEBREW_NO_GITHUB_API=1
export HOMEBREW_NO_ANALYTICS=1
export N_PREFIX=~/.n
# Handle Zsh history
export HISTFILE=~/.zsh_history
export HISTSIZE=10000000
export SAVEHIST=10000000
setopt BANG_HIST # Treat the '!' character specially during expansion.
setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format.
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history.
setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again.
setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate.
setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space.
setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file.
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
setopt HIST_VERIFY # Don't execute immediately upon history expansion.
setopt HIST_BEEP # Beep when accessing nonexistent history.
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_IN.UTF-8"
export LANG="en_US.UTF-8"
# Check if zplug is installed
if [[ ! -d ~/.zplug ]]; then
git clone https://github.com/zplug/zplug ~/.zplug
source ~/.zplug/init.zsh
fi
# Essential
source ~/.zplug/init.zsh
zplug "knu/z", use:z.sh
zplug 'tj/n', as:command, use:'bin/n'
#zplug 'gcuisinier/jenv', as:command, use:'bin/jenv'
zplug 'syndbg/goenv', as:command, use:'bin/goenv'
zplug 'syndbg/goenv', as:command, use:'plugins/go-build/bin/*'
#zplug 'ccontavalli/ssh-ident', as:command, rename-to:'ssh', use:'ssh-ident'
zplug "zsh-users/zsh-autosuggestions", defer:2
zplug "zsh-users/zsh-syntax-highlighting", defer:2
zplug "stedolan/jq", from:gh-r, as:command, rename-to:jq
zplug "golang/dep", from:gh-r, as:command, rename-to:dep
zplug "plugins/common-aliases", from:oh-my-zsh
zplug "plugins/git", from:oh-my-zsh
zplug "rgcr/m-cli", as:command, use:'m', if:"[[ $OSTYPE == *darwin* ]]"
zplug mafredri/zsh-async, from:github
zplug sindresorhus/pure, use:pure.zsh, from:github, as:theme
# Install packages that have not been installed yet
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
#zplug clean --force
zplug load
if type direnv >/dev/null 2>&1; then
eval "$(direnv hook zsh)"
fi
export PATH=$N_PREFIX/bin:$HOME/bin:$PATH
if type jenv > /dev/null 2>&1; then
eval "$(jenv init -)"
fi
if type goenv > /dev/null 2>&1; then
eval "$(goenv init -)"
fi
alias ls='ls -G'
alias j=z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment