Skip to content

Instantly share code, notes, and snippets.

@tranghaviet
Created November 28, 2022 17:33
Show Gist options
  • Save tranghaviet/66c4cf0116ca5cc64444bdb4cb2579e1 to your computer and use it in GitHub Desktop.
Save tranghaviet/66c4cf0116ca5cc64444bdb4cb2579e1 to your computer and use it in GitHub Desktop.
ZSH config with git, linux, docker... aliasas
ZSH_THEME="fletcherm"
HIST_STAMPS="dd.mm.yyyy"
HISTSIZE=10000
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
zsh-completions
zsh-z
docker
docker-compose
)
NOW=$(date '+%Y-%m-%d_%H-%M-%S')
DATE=$(date +%Y-%m-%d)
# -------- GIT --------
alias g="git"
alias ga="git add"
alias gb="git branch"
alias gc="git checkout"
alias gci="git commit -m"
alias gca="git commit -am"
alias gd="git diff"
alias gf="git fetch"
# Beautiful log
alias gl="git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gm="git merge"
alias gp="git push"
alias gr="git rebase"
alias gs="git status"
alias gst="git stash"
alias grm="git rm"
alias gclean="git clean -fd"
# checkout all files
alias gcall="git reset --hard;git clean -df;"
alias nah="git reset --hard;git clean -df;"
# undo
alias gu="git reset HEAD"
alias gundo="git reset --soft HEAD^"
alias gci-fix-conflict="git commit -m \"fix conflict\""
alias gwip="git add -A && git commit -m 'wip'"
alias h="history"
# search history
alias hs="history | grep"
alias cl="clear"
# some more ls aliases
alias ls='ls --color=auto'
alias ll='ls -alF --color=auto'
alias d=docker
alias dc=docker-compose
alias pa="php artisan"
alias cdump="composer dump-autoload"
export PATH="$PATH:$HOME/.composer/vendor/bin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment