-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move common parts to zsh.common and fix make
- Loading branch information
1 parent
d592656
commit d7629b9
Showing
7 changed files
with
68 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env zsh | ||
# Fix terminal colors | ||
local __dircolors_config=~/.config/dircolors/dircolors.solarized-256-dark | ||
if [ -f "${__dircolors_config}" ]; then | ||
eval "$(dircolors "${__dircolors_config}")" | ||
fi | ||
unset __dircolors_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env zsh | ||
# Autoload Functions | ||
|
||
__zshrc_autoload() { | ||
local cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/zsh" | ||
local fp="$cache_dir/autoload-cache.zsh" | ||
if [ ! -f $fp ]; then | ||
echo "Compiling autoload directive" | ||
set -x | ||
local -U autoloaded=($XDG_CONFIG_HOME/zshrc.d/autoloaded/[^_]*(xN:t)) | ||
mkdir -p "$cache_dir" | ||
echo -e "#!/usr/bin/env zsh\nautoload -Uz ${autoloaded[*]}" > "$fp" | ||
zcompile "$fp" &! | ||
set +x | ||
fi | ||
source "$fp" | ||
} | ||
__zshrc_autoload | ||
unset -f __zshrc_autoload # avoid lambdas so we can use zprof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env zsh | ||
|
||
function __zshrc_load_extra() { | ||
local cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/zsh" | ||
local fp="$cache_dir/extras-cache.zsh" | ||
local -U extra priv list | ||
|
||
if [ ! -f "$fp" ]; then | ||
echo "Compiling extra zshrc files" | ||
extra=( | ||
# Meant for external installations, just check if file exists: | ||
/usr/share/autojump/autojump.zs[h](N) # [h] -> POG to activate glob | ||
|
||
# Check if the file is executable (so we can deactivate it with chmod) | ||
$HOME/.config/zsh/+local*.zsh(xN) | ||
# ^ Files specific to host, not shared via dotfiles | ||
$HOME/.config/zshrc.d/?*.zsh(xN) | ||
# ^ Files from other program configurations (e.g. TMUX) | ||
) | ||
set -x | ||
mkdir -p "$cache_dir" | ||
cat $extra > "$fp" | ||
zcompile "$fp" &! | ||
set +x | ||
fi | ||
source "$fp" | ||
} | ||
__zshrc_load_extra | ||
unset -f __zshrc_load_extra # avoid lambdas so zprof can be used |
This file was deleted.
Oops, something went wrong.