-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc.tmpl
99 lines (77 loc) · 3.17 KB
/
dot_zshrc.tmpl
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
# Ensure MacOS treats config in a sane way (and consistent with Linux)
export XDG_CONFIG_HOME="$HOME/.config"
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/.tmux/plugins/tmuxifier/bin:$HOME/.local/bin:$HOME/bin:/usr/local/bin:$PATH
# Init brew
{{ if eq .chezmoi.os "darwin" }}eval "$(/opt/homebrew/bin/brew shellenv)"{{ end }}
{{ if eq .chezmoi.os "linux" }}eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"{{ end }}
alias l='ls -lah --color'
alias ll='ls -lah --color'
export EDITOR='nvim'
alias v='nvim'
alias vi='nvim'
alias vim='nvim'
alias lg='lazygit'
# Python
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
# ZPlugs
export ZPLUG_HOME=$(brew --prefix)/opt/zplug
source $ZPLUG_HOME/init.zsh
# NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$(brew --prefix)/opt/nvm/nvm.sh" ] && \. "$(brew --prefix)/opt/nvm/nvm.sh" # This loads nvm
[ -s "$(brew --prefix)/opt/nvm/etc/bash_completion.d/nvm" ] && \. "$(brew --prefix)/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
# Hombrew Java
export PATH="$(brew --prefix)/opt/homebrew/opt/openjdk/bin:$PATH"
source $(brew --prefix)/opt/zsh-vi-mode/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
source $(brew --prefix)/opt/spaceship/spaceship.zsh
# Init tmuxifier (added to path on top)
export TMUXIFIER_LAYOUT_PATH="$HOME/.config/tmuxifier_layouts"
eval "$(tmuxifier init -)"
# ---- FZF -----
# -- Use fd instead of find in fzf --
export FZF_DEFAULT_COMMAND="fd --hidden --strip-cwd-prefix --exclude .git"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd --type=d --hidden --strip-cwd-prefix --exclude .git"
# Use fd (https://github.com/sharkdp/fd) for listing path candidates.
# - The first argument to the function ($1) is the base path to start traversal
# - See the source code (completion.{bash,zsh}) for the details.
_fzf_compgen_path() {
fd --hidden --exclude .git . "$1"
}
# Use fd to generate the list for directory completion
_fzf_compgen_dir() {
fd --type=d --hidden --exclude .git . "$1"
}
# -- Use fzf.git in fzf --
source ~/fzf-git.sh/fzf-git.sh
# -- fzf Catpucchin Mocha --
export FZF_DEFAULT_OPTS=" \
--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \
--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \
--color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8"
# ---- Eza (better ls) -----
alias ls="eza --color=always --long --git --no-filesize --icons=always --no-time --no-user --no-permissions"
# ---- Zoxide (better cd) ----
eval "$(zoxide init zsh)"
alias cd="z"
# Yazi config to support CWD rename
function yy() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
cd -- "$cwd"
fi
rm -f -- "$tmp"
}
# fzf history
source <(fzf --zsh)
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt appendhistory
{{ if eq .chezmoi.os "darwin" }}# GCC Config MacOS (solves nasty treesitter issues when compiling plugins){{ end }}
{{ if eq .chezmoi.os "darwin" }}export CC=/opt/homebrew/bin/gcc-14{{ end }}
{{ if eq .chezmoi.os "darwin" }}export CXX=/opt/homebrew/bin/g++-14{{ end }}