58 lines
1.5 KiB
Bash
58 lines
1.5 KiB
Bash
# Enable Powerlevel10k instant prompt {{{
|
|
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
|
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
|
fi
|
|
POWERLEVEL9K_INSTANT_PROMPT=quiet
|
|
# }}}
|
|
|
|
# Load Oh My Zsh {{{
|
|
export ZSH="$XDG_CONFIG_HOME/.oh-my-zsh"
|
|
source $ZSH/oh-my-zsh.sh
|
|
# }}}
|
|
|
|
# Theme and prompt {{{
|
|
ZSH_THEME="powerlevel10k/powerlevel10k"
|
|
source $XDG_CONFIG_HOME/p10k/.p10k.zsh
|
|
# }}}
|
|
|
|
# ZSH Plugins {{{
|
|
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
|
|
eval "$(zoxide init zsh)"
|
|
# }}}
|
|
|
|
# Keybindings {{{
|
|
bindkey -v
|
|
export KEYTIMEOUT=1
|
|
# }}}
|
|
|
|
# Aliases and Functions {{{
|
|
# Aliases
|
|
alias h="cd ~"
|
|
alias cl="clear"
|
|
alias tnh="cd /Volumes/TNHOME"
|
|
alias tng="cd /Volumes/TNGROUP"
|
|
alias l='eza --color=always --icons -la --group-directories-first'
|
|
alias n='nvim'
|
|
alias ne='nvim ~/.zshenv'
|
|
alias nz='nvim ~/.config/zsh/.zshrc'
|
|
|
|
# Quick access to notes
|
|
alias nt='nvim ~/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/Privat/TODO.md'
|
|
alias ne='nvim ~/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/Privat/Einkaufsliste.md'
|
|
|
|
# Custom Functions
|
|
# Start yazi with y, and make it cd to pwd on quit
|
|
function y() {
|
|
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
|
|
yazi "$@" --cwd-file="$tmp"
|
|
if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
|
builtin cd -- "$cwd"
|
|
fi
|
|
rm -f -- "$tmp"
|
|
}
|
|
# }}}
|
|
|
|
# iTerm2 shell integration {{{
|
|
source $XDG_CONFIG_HOME/iterm2/.iterm2_shell_integration.zsh
|
|
# }}}
|