Skip to content

Commit 4a42fe0

Browse files
author
jedahan
committed
Add functions to fpath, instead of sourcing one by one
1 parent adf7f7e commit 4a42fe0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

geometry.zsh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ typeset -gA GEOMETRY; GEOMETRY[ROOT]=${0:A:h}
1515

1616
autoload -U add-zsh-hook
1717

18-
function { local fun; for fun ("${GEOMETRY[ROOT]}"/functions/*) . $fun }
18+
fpath+=("${GEOMETRY[ROOT]}"/functions)
19+
autoload "${GEOMETRY[ROOT]}"/functions/*
1920

2021
(( $+functions[ansi] )) || ansi() { (($# - 2)) || echo -n "%F{$1}$2%f"; }
2122
(( $+functions[deansi] )) || deansi() { (($# - 1)) || echo -n "$(echo "$1" | sed s/$(echo "\033")\\\[\[0-9\]\\\{1,2\\\}m//g)"; }

0 commit comments

Comments
 (0)