Aggiunto supporto a ArchLinux base.

This commit is contained in:
Emiliano Vavassori 2022-01-01 01:03:34 +01:00
parent 08fdc8396c
commit f282e9abf8
3 changed files with 61 additions and 33 deletions

42
zsh/archlinux.base.zsh Normal file
View File

@ -0,0 +1,42 @@
# Theming
autoload -Uz promptinit vcs_info
promptinit
zstyle ':vcs_info:*' enable git svn
setopt prompt_subst # Prompting
source ${DOTFILES}/zsh/themes/gentoo.theme-zsh
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

View File

@ -1,5 +1,10 @@
# Theming
autoload -Uz compinit vcs_info
compinit
zstyle ':vcs_info:*' enable git svn zstyle ':vcs_info:*' enable git svn
setopt prompt_subst # Prompting setopt prompt_subst
source $DOTFILES/zsh/themes/gentoo.zsh-theme
setopt correct # Auto correct mistakes setopt correct # Auto correct mistakes
setopt extendedglob # allows regexp with * setopt extendedglob # allows regexp with *
setopt nocaseglob # Case insensitive globbing setopt nocaseglob # Case insensitive globbing
@ -36,3 +41,9 @@ export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;36m' export LESS_TERMCAP_us=$'\E[01;36m'
export LESS=-R export LESS=-R
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

39
zshrc
View File

@ -3,40 +3,17 @@
# Base directories for dotfiles. # Base directories for dotfiles.
export DOTFILES=~/.dotfiles export DOTFILES=~/.dotfiles
# Autocompletion # Autocompletion
export FPATH=$DOTFILES/zsh/functions:$FPATH export FPATH=${DOTFILES}/zsh/functions:${FPATH}
# Base autoloading # Base autoloading
autoload -Uz compaudit compinit vcs_info autoload -Uz compaudit compinit
compinit compinit
# zsh packages from system # zsh packages from system
if uname -a | grep -qi 'debian'; then uname -a | grep -qi 'debian' && source ${DOTFILES}/zsh/debian.base.zsh
# Options for debian uname -a | grep -qi 'manjaro' && source /usr/share/zsh/manjaro-zsh-config && source /usr/share/zsh/manjaro-zsh-prompt
if [ -e $DOTFILES/zsh/debian.base.zsh ]; then uname -a | grep -qi 'archlinux' && source ${DOTFILES}/zsh/archlinux.base.zsh
source $DOTFILES/zsh/debian.base.zsh test -f /etc/redhat-release ] && grep -qi centos /etc/redhat-release && source ${DOTFILES}/zsh/centos.base.zsh
fi
# 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
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
fi
# Plugins # Plugins
for plugin in `find $DOTFILES/zsh/plugins -type f -iname \*.plugin.zsh -print`; do for plugin in `find $DOTFILES/zsh/plugins -type f -iname \*.plugin.zsh -print`; do
@ -53,9 +30,7 @@ done
export EDITOR="/usr/bin/vim" export EDITOR="/usr/bin/vim"
# FZF default options # FZF default options
if [ -x `which fzf 2>/dev/null` ]; then [ -x `which fzf 2>/dev/null` ] && export FZF_DEFAULT_OPTS="--multi --no-mouse --ansi --color=dark"
export FZF_DEFAULT_OPTS="--multi --no-mouse --ansi --color=dark"
fi
# Loading rvm if exists # Loading rvm if exists
[ -f /etc/profile.d/rvm.sh ] && source /etc/profile.d/rvm.sh [ -f /etc/profile.d/rvm.sh ] && source /etc/profile.d/rvm.sh