aboutsummaryrefslogtreecommitdiff
path: root/.config/shell/.zshrc
diff options
context:
space:
mode:
Diffstat (limited to '.config/shell/.zshrc')
-rw-r--r--.config/shell/.zshrc32
1 files changed, 22 insertions, 10 deletions
diff --git a/.config/shell/.zshrc b/.config/shell/.zshrc
index a9d3e89..47a0922 100644
--- a/.config/shell/.zshrc
+++ b/.config/shell/.zshrc
@@ -1,13 +1,25 @@
-# source zsh extensions (order is important)
-source ~/.config/shell/git-prompt.zsh
-source ~/.config/shell/git-prompts/kj_sh604.zsh
-source ~/.config/shell/zsh-autosuggestions/zsh-autosuggestions.zsh
-source ~/.config/shell/zsh-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
-source ~/.config/shell/zsh-history-substring-search/zsh-history-substring-search.zsh
-# source ~/.config/shell/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
-
-[ ! -d ~/.local/state/shell ] && mkdir -p ~/.local/state/shell
-[ ! -f ~/.local/state/shell/zsh_history ] && touch ~/.local/state/shell/zsh_history
+source_if_exists() {
+ [ -f "$1" ] && source "$1"
+}
+
+ensure_directory_and_file() {
+ [ ! -d "$1" ] && mkdir -p "$1"
+ [ ! -f "$2" ] && touch "$2"
+}
+
+
+source_if_exists ~/.config/shell/git-prompt.zsh
+source_if_exists ~/.config/shell/git-prompts/kj_sh604.zsh
+source_if_exists ~/.config/shell/zsh-autosuggestions/zsh-autosuggestions.zsh
+source_if_exists ~/.config/shell/zsh-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
+source_if_exists ~/.config/shell/zsh-history-substring-search/zsh-history-substring-search.zsh
+# source_if_exists ~/.config/shell/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
+
+# Source personal POSIX functions
+source_if_exists ~/.config/shell/posix-functions/create_POSIX_dotenv.sh
+source_if_exists ~/.config/shell/posix-functions/POSIX_open.sh
+
+ensure_directory_and_file ~/.local/state/shell ~/.local/state/shell/zsh_history
# configure history settings
HISTFILE=~/.local/state/shell/zsh_history