-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
104 lines (96 loc) · 2.86 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
setopt AUTO_CD
setopt INTERACTIVE_COMMENTS
setopt HIST_FCNTL_LOCK
setopt HIST_IGNORE_ALL_DUPS
setopt SHARE_HISTORY
# Autoload
autoload -Uz compinit; compinit
autoload -Uz colors && colors
zmodload zsh/complist
# Auto Completion
zstyle ":completion:*" menu select
if whence dircolors >/dev/null; then
eval "$(dircolors -b)"
alias ls='ls --color'
else
export CLICOLOR=1
export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30'
fi
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ":completion:*" use-cache yes
zstyle ":completion:*" special-dirs true
zstyle ":completion:*" squeeze-slashes true
zstyle ":completion:*" file-sort change
zstyle ":completion:*" matcher-list "m:{[:lower:][:upper:]}={[:upper:][:lower:]}" "r:|=*" "l:|=* r:|=*"
# PATH
# Variables
export EDITOR="nvim"
export VISUAL="nvim"
export HOMEBREW_NO_ANALYTICS=1
# Aliases
alias s="fastfetch"
alias ls="lsd"
alias lg="lazygit"
alias vi="\vim"
alias vim="nvim"
alias du="dust -r -n 999999999"
# Frok from: https://github.com/ohmyzsh/ohmyzsh/blob/71cc861806f30d8f7fd3d0040db86737cab62581/lib/directories.zsh
alias -g ..='../'
alias -g ...='../..'
alias -g ....='../../..'
# Initialize tools
if command -v fzf &> /dev/null
then
source <(fzf --zsh) # Fuzzy File Search
else
echo "fzf command not found!"
fi
# Yazi
function yy() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
builtin cd -- "$cwd"
fi
rm -f -- "$tmp"
}
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('~/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "$HOME/miniconda3/etc/profile.d/conda.sh" ]; then
. "$HOME/miniconda3/etc/profile.d/conda.sh"
else
export PATH="$HOME/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
if command -v starship &> /dev/null
then
eval "$(starship init zsh)" # Starship
else
echo "starship command not found!"
fi
if command -v zoxide &> /dev/null
then
eval "$(zoxide init zsh)" # Zoxide
else
echo "zoxide command not found!"
fi
# colored-man-pages
source ~/.config/zsh/plugins/colored-man-pages.zsh
# zsh-syntax-highlighting
if [ ! -d "$HOME/.config/zsh/plugins/zsh-syntax-highlighting" ]; then
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.config/zsh/plugins/zsh-syntax-highlighting
fi
source ~/.config/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# zsh-autosuggestions
if [ ! -d "$HOME/.config/zsh/plugins/zsh-autosuggestions" ]; then
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.config/zsh/plugins/zsh-autosuggestions
fi
source ~/.config/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
# Startup Commands
fastfetch