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
|
2021-12-30 00:39:38 +01:00
|
|
|
# Autocompletion
|
|
|
|
export FPATH=$DOTFILES/zsh/functions:$FPATH
|
2021-12-30 00:18:22 +01:00
|
|
|
|
|
|
|
# Enables base completion
|
2021-12-30 00:39:38 +01:00
|
|
|
autoload -Uz compaudit compinit vcs_info
|
2021-12-30 00:41:06 +01:00
|
|
|
compinit
|
2021-12-30 01:06:02 +01:00
|
|
|
zstyle ':vcs_info:*' enable git svn
|
2021-12-30 01:02:55 +01:00
|
|
|
#precmd() {
|
|
|
|
# vcs_info
|
|
|
|
#}
|
2021-12-30 01:07:26 +01:00
|
|
|
setopt prompt_subst
|
2021-12-30 01:02:55 +01:00
|
|
|
setopt correct # Auto correct mistakes
|
|
|
|
setopt extendedglob # allows regexp with *
|
|
|
|
setopt nocaseglob # Case insensitive globbing
|
|
|
|
setopt rcexpandparam # array expansion with parameters
|
|
|
|
setopt nocheckjobs # No warn about running processes on exiting
|
|
|
|
setopt nobeep
|
|
|
|
setopt appendhistory
|
|
|
|
setopt histignorealldups
|
|
|
|
setopt autocd
|
|
|
|
setopt inc_append_history
|
|
|
|
setopt histignorespace # Ignore putting in history commands beginning with a space
|
|
|
|
|
|
|
|
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Zaz}' # Case insensitive completion
|
|
|
|
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # Color completion
|
|
|
|
zstyle ':completion:*' rehash true # automatically updates new paths
|
|
|
|
# Speed completion
|
|
|
|
zstyle ':completion:*' accept-exact '*(N)'
|
|
|
|
zstyle ':completion:*' use-cache on
|
|
|
|
zstyle ':completion:*' cache-path ~/.zsh/cache
|
|
|
|
|
|
|
|
# History
|
|
|
|
HISTFILE=~/.zhistory
|
|
|
|
HISTSIZE=10000
|
|
|
|
SAVEHIST=10000
|
|
|
|
WORDCHARS=${WORDCHARS//\/[&.;]}
|
|
|
|
|
|
|
|
# Color man pages
|
|
|
|
export LESS_TERMCAP_mb=$'\E[01;32m'
|
|
|
|
export LESS_TERMCAP_md=$'\E[01;32m'
|
|
|
|
export LESS_TERMCAP_me=$'\E[0m'
|
|
|
|
export LESS_TERMCAP_se=$'\E[0m'
|
|
|
|
export LESS_TERMCAP_so=$'\E[01;47;34m'
|
|
|
|
export LESS_TERMCAP_ue=$'\E[0m'
|
|
|
|
export LESS_TERMCAP_us=$'\E[01;36m'
|
|
|
|
export LESS=-R
|
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
|
|
|
|
# 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
|
|
|
|
fi
|
2021-12-29 19:14:18 +01:00
|
|
|
|
|
|
|
# Plugins
|
2021-12-30 00:22:36 +01:00
|
|
|
for plugin in `find $DOTFILES -type f -iname \*.plugin.zsh -print`; do
|
2021-12-30 00:21:22 +01:00
|
|
|
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
|
|
|
|
source ~/.dotfiles/zsh/aliases/*.aliases.zsh
|