aboutsummaryrefslogtreecommitdiff
path: root/.config/shell/.zshrc
diff options
context:
space:
mode:
authorkj-sh6042024-07-17 22:27:14 -0400
committerkj-sh6042024-07-17 22:27:14 -0400
commitfe0f355277b220f304b2e58695349add20741e91 (patch)
treef140ce64ac2bc7bf124a74bf81ca0bdb6c4446ee /.config/shell/.zshrc
parent311ea8ad7c5049ac9efec309b35073b19638054b (diff)
feat: new POSIX and fish functions
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