forked from sorin-ionescu/prezto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
75 lines (68 loc) · 1.93 KB
/
zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
# Customize to your needs...
# ========================================
# Personal coniguration for the shell
# Maciek Bak
# ========================================
# Conda clobbers HOST, so we save the real hostname into another variable.
# https://github.com/conda/conda/issues/7031
HOSTNAME="$(hostname)"
precmd() {
OLDHOST="${HOST}"
HOST="${HOSTNAME}"
}
preexec() {
HOST="${OLDHOST}"
}
# precmd runs right before the prompt is drawn
# preexec runs right after the user hits enter
# Zsh aliases for Git
# https://jonsuh.com/blog/git-command-line-shortcuts/
alias ga='git add'
alias gaa='git add .'
alias gaaa='git add --all'
#alias gau='git add --update'
alias gb='git branch'
alias gbd='git branch --delete '
alias gc='git commit'
alias gcm='git commit --message'
alias gcam='git commit -am'
#alias gcf='git commit --fixup'
alias gco='git checkout'
alias gcob='git checkout -b'
#alias gcom='git checkout master'
#alias gcos='git checkout staging'
#alias gcod='git checkout develop'
alias gd='git diff'
alias gda='git diff HEAD'
alias gi='git init'
alias glg='git log --graph --oneline --decorate --all'
alias gld='git log --pretty=format:"%h %ad %s" --date=short --all'
#alias gm='git merge --no-ff'
#alias gma='git merge --abort'
#alias gmc='git merge --continue'
alias gp='git pull'
#alias gpr='git pull --rebase'
#alias gr='git rebase'
alias gs='git status'
alias gss='git status --short'
alias gst='git stash'
#alias gsta='git stash apply'
#alias gstd='git stash drop'
#alias gstl='git stash list'
#alias gstp='git stash pop'
#alias gsts='git stash save'
alias lk='ls -lhSr' # Sort by size, biggest last.
# tmux
alias tma='tmux attach -d -t'
alias tmn='tmux new -s'
alias tml='tmux list-sessions'