dotfiles/.zshrc

59 lines
1.7 KiB
Bash
Raw Normal View History

2021-12-29 19:14:18 +01:00
# vim:sts=2:sw=2:ft=zsh
2021-12-30 00:18:22 +01:00
# Base directories for dotfiles.
export DOTFILES=~/.dotfiles
# Autocompletion
export FPATH=$DOTFILES/zsh/functions:$FPATH
2021-12-30 00:18:22 +01:00
2021-12-30 01:15:29 +01:00
# Base autoloading
autoload -Uz compaudit compinit vcs_info
compinit
2021-12-29 19:14:18 +01:00
# zsh packages from system
2021-12-30 00:18:22 +01:00
if uname -a | grep -qi 'debian'; then
2021-12-30 01:11:47 +01:00
# Options for debian
if [ -e $DOTFILES/zsh/debian.base.zsh ]; then
source $DOTFILES/zsh/debian.base.zsh
fi
2021-12-30 00:18:22 +01:00
# For Debian, it requires two packages
if [ -e /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
fi
if [ -e /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi
#
# Theme
source $DOTFILES/zsh/themes/gentoo.zsh-theme
elif uname -a | grep -qi '\(arch\|manjaro\)'; then
# Archlinux or manjaro
if [ -e /usr/share/zsh/manjaro-zsh-config ]; then
source /usr/share/zsh/manjaro-zsh-config
fi
if [ -e /usr/share/zsh/manjaro-zsh-prompt ]; then
source /usr/share/zsh/manjaro-zsh-prompt
fi
2021-12-31 23:53:31 +01:00
elif [ -f /etc/redhat-release ] && grep -qi centos /etc/redhat-release; then
# CentOS 7: non c'è un sacco di roba. Mi limito ad abilitare le opzioni native
source $DOTFILES/zsh/centos.base.zsh
2021-12-30 00:18:22 +01:00
fi
2021-12-29 19:14:18 +01:00
# Plugins
for plugin in `find $DOTFILES/zsh/plugins -type f -iname \*.plugin.zsh -print`; do
source $plugin
done
2021-12-29 19:14:18 +01:00
# EDITOR
export EDITOR="/usr/bin/vim"
# FZF default options
export FZF_DEFAULT_OPTS="--multi --no-mouse --ansi --color=dark"
# Loading rvm if exists
[ -f /etc/profile.d/rvm.sh ] && source /etc/profile.d/rvm.sh
# Loading additional aliases
2021-12-30 01:22:40 +01:00
for file in `find $DOTFILES/zsh/aliases -type f -iname \*.aliases.zsh -print`; do
source $file
done