mirror of
https://github.com/reonokiy/dotfiles.git
synced 2025-06-15 14:12:53 +02:00
168 lines
4.9 KiB
Cheetah
168 lines
4.9 KiB
Cheetah
autoload -Uz compinit
|
|
compinit
|
|
|
|
# autocompletion with an arrow-key driven interface
|
|
zstyle ':completion:*' menu select
|
|
|
|
|
|
# create a zkbd compatible hash;
|
|
# to add other keys to this hash, see: man 5 terminfo
|
|
typeset -g -A key
|
|
|
|
key[Home]="${terminfo[khome]}"
|
|
key[End]="${terminfo[kend]}"
|
|
key[Insert]="${terminfo[kich1]}"
|
|
key[Backspace]="${terminfo[kbs]}"
|
|
key[Delete]="${terminfo[kdch1]}"
|
|
key[Up]="${terminfo[kcuu1]}"
|
|
key[Down]="${terminfo[kcud1]}"
|
|
key[Left]="${terminfo[kcub1]}"
|
|
key[Right]="${terminfo[kcuf1]}"
|
|
key[PageUp]="${terminfo[kpp]}"
|
|
key[PageDown]="${terminfo[knp]}"
|
|
key[Shift-Tab]="${terminfo[kcbt]}"
|
|
|
|
# setup key accordingly
|
|
[[ -n "${key[Home]}" ]] && bindkey -- "${key[Home]}" beginning-of-line
|
|
[[ -n "${key[End]}" ]] && bindkey -- "${key[End]}" end-of-line
|
|
[[ -n "${key[Insert]}" ]] && bindkey -- "${key[Insert]}" overwrite-mode
|
|
[[ -n "${key[Backspace]}" ]] && bindkey -- "${key[Backspace]}" backward-delete-char
|
|
[[ -n "${key[Delete]}" ]] && bindkey -- "${key[Delete]}" delete-char
|
|
[[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" up-line-or-history
|
|
[[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" down-line-or-history
|
|
[[ -n "${key[Left]}" ]] && bindkey -- "${key[Left]}" backward-char
|
|
[[ -n "${key[Right]}" ]] && bindkey -- "${key[Right]}" forward-char
|
|
[[ -n "${key[PageUp]}" ]] && bindkey -- "${key[PageUp]}" beginning-of-buffer-or-history
|
|
[[ -n "${key[PageDown]}" ]] && bindkey -- "${key[PageDown]}" end-of-buffer-or-history
|
|
[[ -n "${key[Shift-Tab]}" ]] && bindkey -- "${key[Shift-Tab]}" reverse-menu-complete
|
|
|
|
# Finally, make sure the terminal is in application mode, when zle is
|
|
# active. Only then are the values from $terminfo valid.
|
|
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
|
|
autoload -Uz add-zle-hook-widget
|
|
function zle_application_mode_start { echoti smkx }
|
|
function zle_application_mode_stop { echoti rmkx }
|
|
add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
|
|
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
|
|
fi
|
|
|
|
|
|
# history search
|
|
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
|
|
zle -N up-line-or-beginning-search
|
|
zle -N down-line-or-beginning-search
|
|
|
|
[[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" up-line-or-beginning-search
|
|
[[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" down-line-or-beginning-search
|
|
|
|
|
|
# shift, alt, tab and mod modifiers
|
|
key[Control-Left]="${terminfo[kLFT5]}"
|
|
key[Control-Right]="${terminfo[kRIT5]}"
|
|
|
|
[[ -n "${key[Control-Left]}" ]] && bindkey -- "${key[Control-Left]}" backward-word
|
|
[[ -n "${key[Control-Right]}" ]] && bindkey -- "${key[Control-Right]}" forward-word
|
|
|
|
|
|
# homebrew config
|
|
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
|
|
|
source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh
|
|
source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
|
|
# >>> mamba initialize >>>
|
|
# !! Contents within this block are managed by 'mamba init' !!
|
|
export MAMBA_EXE='/usr/bin/micromamba';
|
|
export MAMBA_ROOT_PREFIX='~/.micromamba';
|
|
__mamba_setup="$("$MAMBA_EXE" shell hook --shell zsh --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
|
|
if [ $? -eq 0 ]; then
|
|
eval "$__mamba_setup"
|
|
else
|
|
alias micromamba="$MAMBA_EXE" # Fallback on help from mamba activate
|
|
fi
|
|
unset __mamba_setup
|
|
# <<< mamba initialize <<<
|
|
|
|
|
|
# starship config
|
|
eval "$(starship init zsh)"
|
|
|
|
# fnm config
|
|
eval "$(fnm env --use-on-cd)"
|
|
|
|
# thefuck config
|
|
fuck() {
|
|
unfunction fuck
|
|
eval $(thefuck --alias)
|
|
fuck "$@"
|
|
}
|
|
|
|
# yazi config
|
|
function ya() {
|
|
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
|
yazi "$@" --cwd-file="$tmp"
|
|
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
|
cd -- "$cwd"
|
|
fi
|
|
rm -f -- "$tmp"
|
|
}
|
|
|
|
# atuin config
|
|
eval "$(atuin init zsh)"
|
|
|
|
# zoxide config
|
|
eval "$(zoxide init zsh)"
|
|
|
|
# editors
|
|
export EDITOR="nano"
|
|
export VISUAL="code"
|
|
|
|
# sops keys
|
|
export SOPS_AGE_RECIPIENTS="op://Private/Age/public key"
|
|
export SOPS_AGE_KEY="op://Private/Age/private key"
|
|
|
|
# custome alias
|
|
# alias code=code-insiders
|
|
alias ..='cd ..'
|
|
alias ...='cd ../..'
|
|
alias ls=eza
|
|
alias f=fuck
|
|
alias v=nvim
|
|
alias sops='op run --no-masking -- sops'
|
|
alias dotfiles='chezmoi'
|
|
|
|
# micromamba|conda alias
|
|
alias mm='micromamba'
|
|
alias ma='micromamba activate'
|
|
alias mda='micromamba activate base'
|
|
alias mc='micromamba create'
|
|
alias mr='micromamba run'
|
|
alias mi='micromamba install'
|
|
alias ml='micromamba list'
|
|
alias me='micromamba env'
|
|
alias mel='micromamba env list'
|
|
alias conda='micromamba'
|
|
|
|
# git alias
|
|
alias gc='git commit'
|
|
alias gcm='git commit -m'
|
|
alias gcl='git clone'
|
|
|
|
# distrobox alias
|
|
alias box='distrobox'
|
|
|
|
alias i='cd ~/i'
|
|
|
|
# Created by `pipx` on 2024-02-17 11:33:21
|
|
export PATH="$PATH:/home/ree/.local/bin"
|
|
|
|
{{if eq .chezmoi.os "windows" -}}
|
|
# windows spec config
|
|
{{- else if eq .chezmoi.os "linux" -}}
|
|
{{- if (.chezmoi.kernel.osrelease | lower | contains "microsoft") -}}
|
|
# wsl spec config
|
|
alias ssh="ssh.exe"
|
|
{{- else -}}
|
|
# linux spec config
|
|
{{- end -}}
|
|
{{- end}}
|