summaryrefslogtreecommitdiff
path: root/zsh/env
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2020-08-30 13:25:12 +0100
committerGrégoire Duchêne <gduchene@awhk.org>2020-08-30 13:25:12 +0100
commitbad0d87c2888b023cca7cd180e63b514e68b8e92 (patch)
treef24cbbf1dd6c0efce74d812418aba5231f4058b6 /zsh/env
parent517cde48c6a16fcad24a6943bc6d0968b101b4a9 (diff)
zsh: Autocomplete op
Diffstat (limited to 'zsh/env')
-rw-r--r--zsh/env6
1 files changed, 5 insertions, 1 deletions
diff --git a/zsh/env b/zsh/env
index b2bd2c9..e150338 100644
--- a/zsh/env
+++ b/zsh/env
@@ -1,7 +1,11 @@
# -*- mode: shell-script -*-
+dotfiles_root() {
+ echo ${${(%):-%x}:A:h:h}
+}
+
source_if_exists() {
- [[ -f ${${(%):-%x}:A:h:h}/$1 ]] && . ${${(%):-%x}:A:h:h}/$1 || return 0
+ [[ -f $(dotfiles_root)/$1 ]] && . $(dotfiles_root)/$1 || return 0
}
export DOMAIN=${$(cut -d. -f2- -s <<<${HOST}):l}