feat manage script
This commit is contained in:
71
config/shared/zsh
Normal file
71
config/shared/zsh
Normal file
@@ -0,0 +1,71 @@
|
||||
# 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
|
||||
|
||||
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
|
||||
|
||||
# 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
|
||||
alias ls='ls --color=auto'
|
||||
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'
|
||||
Reference in New Issue
Block a user