-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc
66 lines (58 loc) · 3.03 KB
/
dot_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
################################
## ##
## History ##
## ##
################################
#
HISTFILE=~/.zsh_history # location of the history file
export HISTFILESIZE=10000000 # history limit of the file on disk
export HISTFILESIZE=10000000 # history limit of the file on disk
export HISTSIZE=10000000 # current session's history limit, also following this https://unix.stackexchange.com/a/595475 $HISTSIZE should be at least 20% bigger than $SAVEHIST
export SAVEHIST=500000 # zsh saves this many lines from the in-memory history list to the history file upon shell exit
setopt INC_APPEND_HISTORY # history file is updated immediately after a command is entered
setopt SHARE_HISTORY # allows multiple Zsh sessions to share the same command history
setopt EXTENDED_HISTORY # records the time when each command was executed along with the command itself
setopt APPENDHISTORY # ensures that each command entered in the current session is appended to the history file immediately after execution
export HISTTIMEFORMAT="%d/%m/%Y %H:%M] "
################################
## ##
## Plugins ##
## ##
################################
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/zsh/plugins/zsh-you-should-use/you-should-use.plugin.zsh
################################
## ##
## Aliases ##
## ##
################################
#
alias vim="nvim"
alias cat="bat"
alias gs='git status'
alias gpo='git pull'
alias ga='git add '
alias gb='git branch '
alias gc='cz commit'
alias gd='git diff'
alias gco='git switch'
alias gsw='git checkout $(git branch -a | fzf | xargs)'
alias gcb='git checkout -b'
alias gpoh='git push -u origin HEAD'
alias ghd='cd $(git rev-parse --show-toplevel)'
alias git_diff_master='git diff master...$(git rev-parse --abbrev-ref HEAD)'
alias git_update_all='find . -type d -depth 1 -exec echo git --git-dir={}/.git --work-tree=$PWD/{} pull \;'
alias git_clean_main='git branch | grep -v \* | grep -v main | xargs git branch -d'
alias git_clean_master='git branch | grep -v \* | grep -v master | xargs git branch -D'
alias gprunesquashmerged='git checkout -q master && git for-each-ref refs/heads/ "--format=%(refname:short)" | while read branch; do mergeBase=$(git merge-base master $branch) && [[ $(git cherry master $(git commit-tree $(git rev-parse "$branch^{tree}") -p $mergeBase -m _)) == "-"* ]] && git branch -D $branch; done'
alias gsquashbranch='git reset $(git merge-base master $(git branch --show-current))'
################################
## ##
## Starship ##
## ##
################################
eval "$(starship init zsh)"
# Created by `pipx` on 2024-08-22 07:19:26
export PATH="$PATH:/home/kiecan/.local/bin"
eval $(thefuck --alias)