Skip to content

Commit

Permalink
maint: clean up zsh{rc,env} & add tmux recipe
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
  • Loading branch information
vladdoster committed Jul 15, 2022
1 parent 8f97fb6 commit 3ed7942
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 29 deletions.
4 changes: 2 additions & 2 deletions zsh/.config/zsh/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ zmodload zsh/complist
# │ LOAD CONFIGURATIONS │
# +─────────────────────+
local files=(aliases fzf zinit)
for f in $files[@]; do
. "${ZDOTDIR:-$HOME/.config/zsh}/$f".zsh
for f in "$files[@]"; do
. "${ZDOTDIR:-$HOME/.config/zsh}/${f}".zsh
done
# +───────────────────────+
# │ Zsh Line Editor (ZLE) │
Expand Down
15 changes: 15 additions & 0 deletions zsh/.config/zsh/zinit.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ zi as'command' for \
atclone'./build.zsh' pick'zunit' \
@zdharma-continuum/zunit
#=== COMPILED PROGRAMS ================================
zi for \
as'null' \
atclone'./configure --disable-utf8proc --prefix=$PWD' \
atpull'%atclone' \
extract'!' \
from'gh-r' \
id-as'tmux' \
lbin'!' \
lucid \
make'-j 8 install' \
nocompile \
ver'latest' \
wait'1' \
@tmux/tmux

zi lucid make'PREFIX=$PWD install' nocompile for \
lbin'!**/bin/tree' Old-Man-Programmer/tree \
lbin'!**/zsd(-*|)$' $ZI_REPO/zshelldoc
Expand Down
55 changes: 28 additions & 27 deletions zsh/.zshenv
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,49 @@
# SYSTEM SPECIFIC

# $- includes i if bash is interactive, allowing a shell script or startup file to test this state
_print() { [[ $- == *i* ]] && print -P "${1}"; }

_def () { [[ ! -z "${(tP)1}" ]]; }
_echo() { [[ $- == *i* ]] && print -P "${1}"; }
path_append() {
for ARG in "$@"; do
if [ -d "$ARG" ] && [[ ":$PATH:" != *":$ARG:"* ]]; then
PATH="${PATH:+"$PATH:"}$ARG"
_print "%F{blue}[INFO]%f: %F{cyan}Appended to PATH%f -> %F{green}${ARG}%f"
PATH="${PATH:+"$PATH:"}$ARG"
_echo "%F{blue}[INFO]%f: %F{cyan}Appended to PATH%f -> %F{green}${ARG}%f"
fi
done
}

activate_brew() {
LOCATIONS=( '/opt/homebrew' '/usr/local' '$HOME/.linuxbrew/Homebrew' '/home/linuxbrew/.linuxbrew' )
for ARG in $LOCATIONS; do
if [[ -e "${ARG}"/bin/brew ]] {
_print "%F{blue}[INFO]%f: %F{cyan}OS%f @ %F{green}${OSTYPE} ($(uname -m))%f"
if eval "$( ${ARG}/bin/brew shellenv )"
_print "%F{blue}[INFO]%f: %F{cyan}Homebrew%f @ %F{green}${ARG}/bin/brew%f"
break
LOCATIONS=( '$HOME/.linuxbrew/Homebrew' '/home/linuxbrew/.linuxbrew' '/opt/homebrew' '/usr/local' )
for F_PATH in $LOCATIONS; do
if [[ -e "${F_PATH}"/bin/brew ]] {
_echo "%F{blue}[INFO]%f: %F{cyan}OS%f @ %F{green}${OSTYPE} [$(uname -m)]%f"
if eval "$( ${F_PATH}/bin/brew shellenv )"; then
_echo "%F{blue}[INFO]%f: %F{cyan}Homebrew%f @ %F{green}${F_PATH}/bin/brew%f"
break
fi
}
done
}
activate_brew
# RESERVED VARIABLES
local usr_path="/usr/local/opt" brew_path="/opt/homebrew/opt"
path_append \
"${HOME}/.cargo/bin" \
"${HOME}/.local/bin" \
"${HOME}/Library/Python/3.8/bin" \
"${HOME}/Library/Python/3.9/bin" \
"${brew_path}/llvm/bin" \
"${brew_path}/make/libexec/gnubin" \
"${usr_path}/binutils/bin" \
"${usr_path}/coreutils/libexec/gnubin" \
"${usr_path}/gnu-sed/libexec/gnubin" \
"${usr_path}/gnu-tar/libexec/gnubin"
# ENV VARIABLES
(( ${+HOSTNAME} )) || export HOSTNAME="$HOST"
(( ${+LANGUAGE} )) || export LANGUAGE="$LANG"
(( ${+USER} )) || export USER="$USERNAME"
local usr_path="/usr/local/opt" brew_path="/opt/homebrew/opt"
path_append "${HOME}/.cargo/bin"
path_append "${HOME}/.local/bin" # personal scripts
path_append "${HOME}/Library/Python/3.8/bin"
path_append "${HOME}/Library/Python/3.9/bin"
path_append "${brew_path}/llvm/bin"
path_append "${brew_path}/make/libexec/gnubin"
path_append "${usr_path}/binutils/bin"
path_append "${usr_path}/coreutils/libexec/gnubin"
path_append "${usr_path}/gnu-sed/libexec/gnubin"
path_append "${usr_path}/gnu-tar/libexec/gnubin"
# XDG ENV VARIABLES
(( ${+XDG_CACHE_HOME} )) || export XDG_CACHE_HOME="$HOME/.cache"
(( ${+USER} )) || export USER="$USERNAME"
(( ${+XDG_CACHE_HOME} )) || export XDG_CACHE_HOME="$HOME/.cache"
(( ${+XDG_CONFIG_HOME} )) || export XDG_CONFIG_HOME="$HOME/.config"
(( ${+XDG_DATA_HOME} )) || export XDG_DATA_HOME="$HOME/.local/share"
(( ${+XDG_DATA_HOME} )) || export XDG_DATA_HOME="$HOME/.local/share"
export AZURE_CONFIG_DIR="$XDG_DATA_HOME"/azure
export DOTFILES="$XDG_CONFIG_HOME"/dotfiles
export GIT_CONFIG="$XDG_CONFIG_HOME"/git/config
Expand Down

0 comments on commit 3ed7942

Please sign in to comment.