-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.zshrc
110 lines (94 loc) · 3.76 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Homebrew
[[ -d /opt/homebrew/bin ]] && export PATH=/opt/homebrew/bin:$PATH
[[ -d /opt/homebrew/sbin ]] && export PATH=/opt/homebrew/sbin:$PATH
[[ -d /opt/homebrew/opt/gnu-sed/libexec/gnubin ]] && export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
# Alias
alias import-instance-start=~/.dotfiles/scripts/import-instance-start
alias import-instance-stop=~/.dotfiles/scripts/import-instance-stop
alias upgrade=~/.dotfiles/scripts/upgrade
alias ..='cd ..'
alias :q='exit'
[[ ! -z `command -v nvim` ]] && alias vim='nvim'
[[ ! -z `command -v nvim` ]] && alias v='nvim'
[[ ! -z `command -v nvim` ]] && alias n='nvim'
[[ ! -z `command -v tokei` ]] && alias loc='tokei'
[[ ! -z `command -v eza` ]] && alias ls='eza'
alias t='tmux'
alias tm='tmux'
[[ ! -z `command -v htop` ]] && alias top='htop'
# Oh-my-zsh git aliases
alias g='git'
alias '??'='ghcs'
alias ga='git add'
alias gaa='git add --all'
alias gap='git apply'
alias gapa='git add --patch'
alias gapt='git apply --3way'
alias gau='git add --update'
alias gav='git add --verbose'
alias gb='git branch'
alias gbD='git branch -D'
alias gba='git branch -a'
alias gbd='git branch -d'
alias gbda='git branch --no-color --merged | command grep -vE "^([+*]|\s*($(git_main_branch)|$(git_develop_branch))\s*$)" | command xargs git branch -d 2>/dev/null'
alias gbl='git blame -b -w'
alias gbnm='git branch --no-merged'
alias gbr='git branch --remote'
alias gbs='git bisect'
alias gbsb='git bisect bad'
alias gbsg='git bisect good'
alias gbsr='git bisect reset'
alias gbss='git bisect start'
alias gc!='git commit -v --amend'
alias gc='git commit -v'
alias gca!='git commit -v -a --amend'
alias gca='git commit -v -a'
alias gcam='git commit -a -m'
alias gcan!='git commit -v -a --no-edit --amend'
alias gcans!='git commit -v -a -s --no-edit --amend'
alias gcas='git commit -a -s'
alias gcasm='git commit -a -s -m'
alias gcb='git checkout -b'
alias gcf='git config --list'
alias gcn!='git commit -v --no-edit --amend'
alias gco='git checkout'
alias gcsm='git commit -s -m'
alias gp='git_hook_push && git push'
alias gpsup='git push --set-upstream origin $(git branch --show-current)'
alias grbc='git rebase --continue'
alias grbm='git rebase $(git_main_branch)'
alias gs='git status'
alias oc='OCO_AI_PROVIDER="ollama" OCO_MODEL=mistral OCO_LOCAL_MODEL_LLAMA=mistral opencommit'
# Vim
bindkey -v
# History
export HISTSIZE=10000 # Set history size
export SAVEHIST=10000 # Save history after logo
setopt INC_APPEND_HISTORY # Append into history file
setopt HIST_IGNORE_DUPS # Save only one command if 2 common are same and consistent
setopt EXTENDED_HISTORY # Add timestamp for each entry
# Starship
eval "$(starship init zsh)"
# Volta
[[ -d $HOME/.volta ]] && export VOLTA_HOME="$HOME/.volta" && export PATH="$VOLTA_HOME/bin:$PATH"
# Krew
[[ -d $HOME/.krew ]] && export PATH="$HOME/.krew/bin:$PATH"
# Setup default editor
[[ ! -z `command -v nvim` ]] && export EDITOR=nvim
# Setup python
[[ ! -z `brew --prefix python` ]] && export PATH="$(brew --prefix python)/libexec/bin:$PATH"
# Setup ruby
[[ ! -z `brew --prefix ruby` ]] && export PATH="$(brew --prefix ruby)/bin:$PATH"
# Auto suggestion
[[ -f ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh ]] && source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
# Syntax
[[ -f ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]] && source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
[[ -d ~/.zsh/zsh-completions ]] && fpath=(~/.zsh/zsh-completions $fpath)
# Postgresql
[[ -d $(brew --prefix)/opt/postgresql@16 ]] && export PATH="$(brew --prefix)/opt/postgresql@16/bin:$PATH"
# Fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# Copilot
[[ ! -z `command -v gh copilot` ]] && eval "$(gh copilot alias -- zsh)"
# Broot
[ -f ~/.config/broot/launcher/bash/br ] && source ~/.config/broot/launcher/bash/br