Files
dotfiles/base/zshrc
Ismo Vuorinen e5d6cb37fd shell: have, path_(append|prepend|remove)
- have: command -v shorthand
- path_append: appends dir to PATH
- path_prepend: prepends dir to PATH
- path_remove: removes dir from PATH
2023-04-14 00:42:08 +03:00

44 lines
1.1 KiB
Bash

# this is my zsh config. there are many like it, but this one is mine.
# shellcheck shell=bash
autoload -U colors zsh/terminfo
colors
# Defaults
export DOTFILES="$HOME/.dotfiles"
# shellcheck source=shared.sh
source "$DOTFILES/scripts/shared.sh"
# Run x-load-configs in your terminal to reload the files.
function x-load-configs()
{
# Load the shell dotfiles, and then some:
for file in $DOTFILES/config/{exports,alias,functions}; do
[ -f "$file" ] && source "$file"
[ -f "$file-secret" ] && source "$file-secret"
[ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
[ -f "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret"
done
}
x-load-configs
# Import ssh keys in keychain
ssh-add -A 2>/dev/null;
# Try to load antigen, if present
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
# antigen is present
have antigen && {
antigen use oh-my-zsh
# config/functions
x-default-antigen-bundles
antigen apply
}
# starship is present
have starship && eval "$(starship init zsh)"