mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
71 lines
2.1 KiB
Bash
71 lines
2.1 KiB
Bash
# this is my zsh config. there are many like it, but this one is mine.
|
|
# shellcheck shell=bash
|
|
|
|
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
|
# Initialization code that may require console input (password prompts, [y/n]
|
|
# confirmations, etc.) must go above this block; everything else may go below.
|
|
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
|
|
|
|
# Fig pre block. Keep at the top of this file.
|
|
[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] \
|
|
&& builtin source "$HOME/.fig/shell/zshrc.pre.zsh"
|
|
|
|
# Defaults
|
|
export DOTFILES="$HOME/.dotfiles"
|
|
# shellcheck source=shared.sh
|
|
source "$DOTFILES/scripts/shared.sh"
|
|
|
|
autoload -U colors zsh/terminfo
|
|
colors
|
|
setopt correct
|
|
|
|
# Add completion scripts to zsh path
|
|
FPATH="~/.config/zsh/completion:$FPATH"
|
|
autoload -Uz compinit && compinit -i
|
|
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
|
|
|
|
# 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
|
|
[ -r "$file" ] && source "$file"
|
|
[ -r "$file-secret" ] && source "$file-secret"
|
|
[ -r "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
|
|
[ -r "$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
|
|
}
|
|
|
|
[ -f "${DOTFILES}/config/fzf/fzf.zsh" ] \
|
|
&& source "${DOTFILES}/config/fzf/fzf.zsh"
|
|
|
|
export LESSHISTFILE="$XDG_CACHE_HOME"/less_history
|
|
|
|
# Fig post block. Keep at the bottom of this file.
|
|
[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] \
|
|
&& builtin source "$HOME/.fig/shell/zshrc.post.zsh"
|
|
|
|
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
|
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
|
|