-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathzshrc
More file actions
126 lines (104 loc) · 3.04 KB
/
zshrc
File metadata and controls
126 lines (104 loc) · 3.04 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Custom settings
# ---
export LANG=en_US.UTF-8
export EDITOR=nvim
# Make aliase for bat if batcat is found
if command -v batcat &> /dev/null; then
alias bat="batcat"
fi
# System
if command -v eza &> /dev/null; then
alias ls="EZA_COLORS='reset' eza --group-directories-first --icons=auto --classify --all"
alias ll="EZA_COLORS='reset' eza --group-directories-first --group --icons=auto --classify --all --long"
else
alias ll="ls -lA"
fi
alias mkdir="mkdir -pv"
alias cp="cp -v"
alias open-ports="sudo ss -ltnp"
alias grep="grep --color=auto"
# Neovim
export PYTHON3_HOST_PROG=$(which python3)
# Git aliases
alias g="git"
alias gA="git add -A"
alias ga="git add"
alias gbr="git branch"
alias gcl="git clone"
alias gcm="git commit"
alias gco="git checkout"
alias gm="git merge"
alias gd="git diff"
alias gds="git diff --staged"
alias gf="git fetch"
alias gls="git log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short"
alias gi="git init; git add -A && git commit -m 'feat: init'"
alias gl="git pull"
alias gp="git push"
alias gre="git reset"
alias greh="git reset --hard HEAD"
alias gres="git reset --soft HEAD"
alias grs="git restore"
alias grss="git restore --staged"
alias grm="git remote"
alias grmao="git remote add origin"
alias gs="git status"
alias gst="git stash"
alias gt="git tag"
# Personal aliases
alias cddot="cd ~/dotfiles"
alias cdnvim="cd ~/dotfiles/config/nvim"
alias cdp="cd ~/projects/github.com/creativenull"
alias cdd="cd ~/projects/demos"
# zsh settings
# ---
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
if [ -d "$HOME/.deno/bin" ] ; then
PATH="$HOME/.deno/bin:$PATH"
fi
# Tab and Shift Tab to auto complete
bindkey '^I' expand-or-complete
bindkey '^[[Z' reverse-menu-complete
bindkey '^N' expand-or-complete
bindkey '^P' reverse-menu-complete
bindkey '^R' history-incremental-search-backward
bindkey '^S' history-incremental-search-forward
autoload -Uz compinit; compinit
zstyle ':completion:*' menu select
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt SHARE_HISTORY
setopt HIST_IGNORE_ALL_DUPS
# Deno plugin
# ---
source ~/.config/zsh-plugins/zsh-deno/deno.plugin.zsh
# Autosuggestions plugin
# ---
source ~/.config/zsh-plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
bindkey '^ ' autosuggest-accept
# Syntax highlighting plugin
# ---
source ~/.config/zsh-plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
# History substring search plugin
# ---
source ~/.config/zsh-plugins/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh
if [ "$(uname)" != "Darwin" ]; then
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
else
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
fi
# Laravel artisan plugin
# ---
source ~/.config/zsh-plugins/zsh-artisan/artisan.plugin.zsh
# Custom completions location
fpath=($HOME/.zsh/completions $fpath)
autoload -U compinit; compinit
# Starship
# ---
eval "$(starship init zsh)"