dotfiles/zshrc

72 lines
1.7 KiB
Bash

# vim:sts=2:sw=2:ft=zsh
# Base directories for dotfiles.
export DOTFILES=${HOME}/.dotfiles
# Autocompletions
export FPATH=${HOME}/.zsh/functions:${DOTFILES}/zsh/functions:${FPATH}
# Base autoloading
autoload -Uz compaudit compinit
compinit
# zsh packages from system
source ${DOTFILES}/zsh/distro.base.zsh
# Plugins
for plugin in `find $DOTFILES/zsh/plugins -iname \*.plugin.zsh -print`; do
if [ -f /etc/redhat-release ]; then
if [ "$(basename ${plugin})" != 'fzf.plugin.zsh' ]; then
source $plugin
fi
else
source $plugin
fi
done
for plugin in `find $DOTFILES/zsh/plugins -iname \*.plugin.zsh -print`; do
if [ -f /etc/redhat-release ]; then
if [ "$(basename ${plugin})" != 'fzf.plugin.zsh' ]; then
source $plugin
fi
else
source $plugin
fi
done
# Antigen configuration
# the main pluing should have been sourced in the previous loop.
antigen bundle command-not-found
antigen bundle common-aliases
antigen bundle copyfile
antigen bundle fd
antigen bundle fzf
antigen bundle git
antigen bundle pip
antigen bundle python
antigen bundle rsync
antigen bundle sudo
antigen bundle systemadmin
antigen bundle systemd
antigen bundle z
antigen bundle sunlei/zsh-ssh
antigen apply
# EDITOR
export EDITOR="/usr/bin/vim"
export ZSH_TMUX_CONFIG=${HOME}/.config/tmux/tmux.conf
# FZF default options
[ -x `which fzf 2>/dev/null` ] && export FZF_DEFAULT_OPTS="--multi --no-mouse --ansi --color=dark"
# Loading additional aliases
for file in `find $DOTFILES/zsh/aliases -iname \*.aliases.zsh -print`; do
source $file
done
if [[ -d $HOME/.zsh/conf.d ]]; then
for file in `find $HOME/.zsh/conf.d -type f -iname \*.zsh -print | sort`; do
source file
done
fi