Add zsh plugin support to zshrc
This commit is contained in:
parent
3bff31a4cc
commit
9d558cf7f3
3
zshenv
3
zshenv
|
@ -1,6 +1,3 @@
|
||||||
fpath=($fpath $HOME/.zsh/func)
|
|
||||||
typeset -U fpath
|
|
||||||
|
|
||||||
# Unbreak broken, non-colored terminal
|
# Unbreak broken, non-colored terminal
|
||||||
export TERM=xterm-256color
|
export TERM=xterm-256color
|
||||||
|
|
||||||
|
|
30
zshrc
30
zshrc
|
@ -3,6 +3,35 @@ platform=`uname`
|
||||||
# Path to your oh-my-zsh configuration.
|
# Path to your oh-my-zsh configuration.
|
||||||
ZSH=$HOME/.zsh
|
ZSH=$HOME/.zsh
|
||||||
|
|
||||||
|
# Plugins to enable - they are found in .zsh/plugins
|
||||||
|
PLUGINS=()
|
||||||
|
|
||||||
|
fpath=($fpath $ZSH/func)
|
||||||
|
typeset -U fpath
|
||||||
|
|
||||||
|
is_plugin() {
|
||||||
|
local base_dir=$1
|
||||||
|
local name=$2
|
||||||
|
test -f $base_dir/plugins/$name/$name.plugin.zsh \
|
||||||
|
|| test -f $base_dir/plugins/$name/_$name
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add all defined plugins to fpath. This must be done
|
||||||
|
# before running compinit.
|
||||||
|
for plugin ($PLUGINS); do
|
||||||
|
if is_plugin $ZSH $plugin; then
|
||||||
|
fpath=($ZSH/plugins/$plugin $fpath)
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Load all of the plugins that were defined in ~/.zshrc
|
||||||
|
for plugin ($PLUGINS); do
|
||||||
|
if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
|
||||||
|
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Setup the custom prompt
|
||||||
setopt promptsubst
|
setopt promptsubst
|
||||||
autoload -U promptinit
|
autoload -U promptinit
|
||||||
promptinit
|
promptinit
|
||||||
|
@ -16,6 +45,7 @@ if [[ $platform == 'Linux' ]]; then
|
||||||
xcape -e 'Caps_Lock=Escape'
|
xcape -e 'Caps_Lock=Escape'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Autoload things before calling compinit
|
||||||
autoload -Uz compinit
|
autoload -Uz compinit
|
||||||
compinit
|
compinit
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user