-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc
70 lines (58 loc) · 1.54 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
67
68
69
70
bindkey -e
export EDITOR='nvim'
# History
HISTSIZE=999999
HISTFILE=~/.zsh_history
SAVEHIST=$HISTSIZE
HITDUP=erase
setopt sharehistory
setopt hist_ignore_space
setopt hist_ignore_all_dups
setopt hist_ignore_dups
setopt hist_save_no_dups
setopt hist_find_no_dups
# Aliases
alias bat='batcat'
alias cat='bat'
alias fd="fdfind"
alias l='ls -CF'
alias ls='ls -lhG'
alias la='ls -lahG'
alias lg='lazygit'
alias ld='lazydocker'
alias n='nvim'
alias v='nvim'
alias vim='nvim'
alias y='yazi'
# Styles
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
# FZF Settings
export FZF_COMPLETION_TRIGGER='~~'
export FZF_DEFAULT_OPTS='-i --height=60% --layout=reverse'
_fzf_compgen_path() {
fd --hidden --follow --exclude ".git" . "$1"
}
_fzf_compgen_dir() {
fd --type d --hidden --follow --exclude ".git" . "$1"
}
_fzf_comprun() {
local command=$1
shift
case "$command" in
cd) fzf --preview 'tree -C {} | head -200' "$@" ;;
export|unset) fzf --preview "eval 'echo \$'{}" "$@" ;;
ssh) fzf --preview 'dig {}' "$@" ;;
*) fzf --preview 'bat -n --color=always --line-range :500 {}' "$@" ;;
esac
}
eval "$(fzf --zsh)"
eval "$(zoxide init zsh)"
eval "$(starship init zsh)"
PATH_PREFIX="/usr"
if [[ "$(uname -s)" == "Darwin" ]]; then
PATH_PREFIX="/opt/homebrew"
fi
source $PATH_PREFIX/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source $PATH_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
FPATH=$PATH_PREFIX/share/zsh-completions:$FPATH
autoload -Uz compinit && compinit