Chunk & Split zshrc into smaller files

This commit is contained in:
pfych 2025-02-19 13:47:48 +11:00
parent 1314b22f27
commit 7fd48fb729
5 changed files with 57 additions and 51 deletions

11
.config/zsh/darwin.sh Normal file
View file

@ -0,0 +1,11 @@
if [[ $(uname -m) == 'arm64' ]]; then
# Homebrew has a different location on M series devices
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH:${HOME}/.local/bin:/usr/local/sbin:${HOME}/.local/share/gem/ruby/2.0.0/bin:/usr/local/bin"
export ANDROID_SDK_ROOT=/Users/$USER/Library/Android/sdk
eval "$(rbenv init - zsh)"
alias date=gdate;

1
.config/zsh/linux.sh Normal file
View file

@ -0,0 +1 @@
export PATH="${PATH}:${HOME}/.local/bin:/usr/local/sbin:${HOME}/.local/share/gem/ruby/2.0.0/bin:/usr/local/bin"

14
.config/zsh/plugins.sh Normal file
View file

@ -0,0 +1,14 @@
source "$CONFIGDIR/zsh/plugins/zsh-git-prompt/zshrc.sh"
source "$CONFIGDIR/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
source "$CONFIGDIR/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"
# Autocomplete
ZSH_AUTOSUGGEST_USE_ASYNC=true
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
# Prompt
precmd() {
PROMPT="[%c] "
RPROMPT="$(git_super_status)"
}

21
.config/zsh/shared.sh Normal file
View file

@ -0,0 +1,21 @@
# Use NVIM
alias vim=nvim
# NVM
export NVM_DIR="$CONFIGDIR/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Nodejs
export SKIP_PREFLIGHT_CHECK=true
# FZF
export FZF_DEFAULT_COMMAND='find . -type d \( -name Pods -o -name .yarn -o -name node_modules -o -name .git -o -path name \) -prune -false -o -name "*"'
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# thefuck
eval $(thefuck --alias)
alias a=fuck
# Load extra functions
source "$CONFIGDIR/scripts/scripts.sh"