1
Fork 0
dots/zsh/dot-zshrc
2023-08-31 02:45:02 +05:00

27 lines
931 B
Bash

function create_dir() [ ! -d "$1" ] && mkdir -p "$1"
function safe_source() [ -f "$1" ] && source "$1"
function zsh_add_file() safe_source "$ZDOTDIR/$1"
function zsh_add_plugin() {
PLUGIN_NAME=$(echo $1 | cut -d "/" -f 2)
[ ! -d "$HOME/.local/share/zsh/plugins/$PLUGIN_NAME" ] &&
git clone "https://github.com/$1.git" "$HOME/.local/share/zsh/plugins/$PLUGIN_NAME"
safe_source "$HOME/.local/share/zsh/plugins/$PLUGIN_NAME/$PLUGIN_NAME.plugin.zsh"
safe_source "$HOME/.local/share/zsh/plugins/$PLUGIN_NAME/$PLUGIN_NAME.zsh"
}
zsh_add_file "zsh-aliases"
zsh_add_file "zsh-functions"
zsh_add_file "zsh-options"
zsh_add_plugin "Aloxaf/fzf-tab"
zsh_add_plugin "ahmubashshir/zinsults"
zsh_add_plugin "zdharma-continuum/fast-syntax-highlighting"
zsh_add_plugin "zsh-users/zsh-autosuggestions"
zsh_add_plugin "zsh-users/zsh-completions"
zsh_add_file "zsh-completion"
zsh_add_file "zsh-bindings"
# vim: filetype=zsh