Major cleanup and restructuring
- remove custom module loader, use zplug for own plugins - move config parts from modules to files - move other module parts to separate zsh plugins
This commit is contained in:
parent
98a86e6b70
commit
d0598c2838
21 changed files with 38 additions and 774 deletions
44
plugins/autoloader/autoloader.plugin.zsh
Normal file
44
plugins/autoloader/autoloader.plugin.zsh
Normal file
|
@ -0,0 +1,44 @@
|
|||
#!/bin/zsh
|
||||
|
||||
#################################################################################
|
||||
# ZSH zle widget and custom function autloader
|
||||
#################################################################################
|
||||
#
|
||||
# Lets you load custom functions and zle widgets split into single files.
|
||||
#
|
||||
# zle widgets are stored in the "widgets" folder in your configuration directory
|
||||
# (set with $ZDOTDIR, see manpage). The widgets in /etc/zsh/widgets are also
|
||||
# considered.
|
||||
#
|
||||
# functions are stored in the "functions" folder analogous.
|
||||
#
|
||||
|
||||
if [[ -z $ZWIDGETPATH ]]; then
|
||||
ZWIDGETPATH=( ${ZDOTDIR:+$ZDOTDIR/widgets} )
|
||||
[[ -d /etc/zsh/widgets ]] && ZWIDGETPATH+=/etc/zsh/widgets
|
||||
fi
|
||||
|
||||
if [[ -z $ZFUNCTIONPATH ]]; then
|
||||
ZFUNCTIONPATH=( ${ZDOTDIR:+$ZDOTDIR/functions} )
|
||||
[[ -d /etc/zsh/functions ]] && ZFUNCTIONPATH+=/etc/zsh/functions
|
||||
fi
|
||||
|
||||
fpath+=(${ZWIDGETPATH})
|
||||
fpath+=(${ZFUNCTIONPATH})
|
||||
|
||||
for dir in $ZWIDGETPATH; do
|
||||
if [ -d $dir ]; then
|
||||
for i in $dir/*~*.zwc(N:t); do
|
||||
autoload -Uz $i
|
||||
zle -N $i
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
for dir in $ZFUNCTIONPATH; do
|
||||
if [ -d $dir ]; then
|
||||
for i in $dir/*~*.zwc(N:t); do
|
||||
autoload -Uz $i
|
||||
done
|
||||
fi
|
||||
done
|
31
plugins/highlight-config/highlight-config.plugin.zsh
Normal file
31
plugins/highlight-config/highlight-config.plugin.zsh
Normal file
|
@ -0,0 +1,31 @@
|
|||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
|
||||
|
||||
if [[ "`tput colors`" == "256" ]] || [[ "`tput colors`" == "88" ]] ; then
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[command]='fg=74'
|
||||
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=74'
|
||||
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=74'
|
||||
ZSH_HIGHLIGHT_STYLES[function]='fg=74'
|
||||
ZSH_HIGHLIGHT_STYLES[alias]='fg=74,underline'
|
||||
ZSH_HIGHLIGHT_STYLES[builtin]='fg=74,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[path]='fg=120'
|
||||
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=215,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[globbing]='fg=215,bold'
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=203,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=203'
|
||||
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=33'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=51'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=40'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=35'
|
||||
ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]='bold,bg=75'
|
||||
|
||||
ZSH_HIGHLIGHT_PATTERNS+=('${*}' 'fg=215')
|
||||
|
||||
else
|
||||
|
||||
ZSH_HIGHLIGHT_PATTERNS+=('${*}' 'fg=yellow')
|
||||
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue