unix-config/.zshrc

59 lines
1.7 KiB
Bash

# Path
if [[ $(uname) == "Darwin" ]]; then
if [[ $(uname -m) == 'arm64' ]]; then
# Homebrew has a different location on M series devices
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH:${HOME}/.local/bin:/usr/local/sbin:${HOME}/.local/share/gem/ruby/2.0.0/bin:/usr/local/bin"
export ANDROID_SDK_ROOT=/Users/$USER/Library/Android/sdk
alias date=gdate;
eval "$(rbenv init - zsh)"
else
export PATH="${PATH}:${HOME}/.local/bin:/usr/local/sbin:${HOME}/.local/share/gem/ruby/2.0.0/bin:/usr/local/bin"
fi
# Config
export CONFIGDIR="${HOME}/.config"
export XDG_CONFIG_HOME=$CONFIGDIR
export EDITOR=nvim
# Plugins
source "$CONFIGDIR/zsh/plugins/zsh-git-prompt/zshrc.sh"
source "$CONFIGDIR/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
source "$CONFIGDIR/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"
# Use NVIM
alias vim=nvim
# NVM
export NVM_DIR="$CONFIGDIR/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Autocomplete
ZSH_AUTOSUGGEST_USE_ASYNC=true
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
# Prompt
precmd() {
PROMPT="[%c] "
RPROMPT="$(git_super_status)"
}
# Added by serverless binary installer
export PATH="$HOME/.serverless/bin:$PATH"
# Nodejs
export SKIP_PREFLIGHT_CHECK=true
# FZF
export FZF_DEFAULT_COMMAND='find . -type d \( -name Pods -o -name .yarn -o -name node_modules -o -name .git -o -path name \) -prune -false -o -name "*"'
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# thefuck
eval $(thefuck --alias)
alias a=fuck
# Load extra functions
source ~/.config/scripts/scripts.sh