From f7714020076913202359c80ed22df3a37725b6a7 Mon Sep 17 00:00:00 2001 From: Keanu Date: Wed, 23 Jun 2021 12:27:02 +0200 Subject: [PATCH] [zsh] Implement loading of custom scripts. --- zsh/.gitignore | 1 + zsh/zshrc | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 zsh/.gitignore diff --git a/zsh/.gitignore b/zsh/.gitignore new file mode 100644 index 0000000..0d82d79 --- /dev/null +++ b/zsh/.gitignore @@ -0,0 +1 @@ +custom diff --git a/zsh/zshrc b/zsh/zshrc index 0c049bb..49d327b 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -1,11 +1,15 @@ #!/usr/bin/env zsh -K_ZSH_DOTFILES="${0:h}" - # Get this file's current directory and source Dima's zshrc from there -SCRIPT_DIR="$( dirname "$( readlink -f "$0" )" )" -source $SCRIPT_DIR/../dmitmel-dotfiles/zsh/zshrc +K_ZSH_DOTFILES="$( dirname "$( readlink -f "$0" )" )" +source $K_ZSH_DOTFILES/../dmitmel-dotfiles/zsh/zshrc for script in functions; do source "$K_ZSH_DOTFILES/$script.zsh" done + +if [[ -d "$K_ZSH_DOTFILES/custom" ]]; then + for script in $K_ZSH_DOTFILES/custom/*.zsh; do + source "$script" + done +fi