83 lines
2.2 KiB
Plaintext
83 lines
2.2 KiB
Plaintext
# Add /bin to path
|
|
export PATH="$PATH:$HOME/bin"
|
|
|
|
# Set locales
|
|
export LANGUAGE="en_US:en"
|
|
export LANG=en_US.UTF-8
|
|
export LC_ALL=en_US.UTF-8
|
|
export KUBECONFIG=~/.kube/config
|
|
autoload -Uz compinit && compinit # Autocomplete
|
|
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case Insensitive
|
|
|
|
setopt autocd # cd without it
|
|
setopt share_history
|
|
|
|
# Set terminal title to hostname
|
|
echo -n -e "\033]0;SSH: $(hostname)\007"
|
|
|
|
# Git prompt function
|
|
git_prompt_info() {
|
|
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
local branch=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD)
|
|
echo " %F{green}($branch)%f"
|
|
fi
|
|
}
|
|
|
|
# Set up the prompt
|
|
setopt PROMPT_SUBST # Dyna
|
|
PROMPT='%n@%m%f %F{blue}%~%f$(git_prompt_info) $ '
|
|
|
|
# Disable the log builtin, so we don't conflict with /usr/bin/log
|
|
disable log
|
|
|
|
# Save command history
|
|
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
|
|
HISTSIZE=2000
|
|
SAVEHIST=1000
|
|
setopt HIST_IGNORE_ALL_DUPS
|
|
|
|
# Load functions
|
|
autoload -U up-line-or-beginning-search
|
|
autoload -U down-line-or-beginning-search
|
|
zle -N up-line-or-beginning-search
|
|
zle -N down-line-or-beginning-search
|
|
|
|
# Bind both common escape sequences
|
|
bindkey '^[[A' up-line-or-beginning-search # normal mode
|
|
bindkey '^[OA' up-line-or-beginning-search # application mode
|
|
bindkey '^[[B' down-line-or-beginning-search # normal mode
|
|
bindkey '^[OB' down-line-or-beginning-search # application mode
|
|
|
|
# Aliases for ls
|
|
OS_TYPE=$(uname)
|
|
if [[ "$OS_TYPE" == "Linux" ]]; then
|
|
alias ls='ls --color=auto --group-directories-first'
|
|
elif [[ "$OS_TYPE" == "Darwin" ]]; then
|
|
alias ls='ls --color=auto'
|
|
fi
|
|
alias ll='ls -lF'
|
|
alias lla='ll -a'
|
|
alias ld='ls -ld */' # List only directories
|
|
|
|
# Aliases for git
|
|
alias g='git'
|
|
alias ga='git add'
|
|
alias gaa='git add --all'
|
|
alias gb='git branch'
|
|
alias gcm='git commit -m'
|
|
alias gam='git commit -am'
|
|
alias gco='git checkout'
|
|
alias gd='git diff'
|
|
alias gf='git fetch'
|
|
alias gl='git pull'
|
|
alias gp='git push'
|
|
alias gst='git status'
|
|
alias glg='git log --graph --oneline --decorate --all'
|
|
alias gm='git merge'
|
|
alias grb='git rebase'
|
|
alias grs='git reset'
|
|
alias grv='git remote -v'
|
|
alias k='kubectl'
|
|
alias tree='tree -I node_modules'
|
|
alias vim=nvim
|