[zsh] Clean up and move init_env to init-unix-env

This commit is contained in:
Eryn Wells 2024-09-23 18:13:46 -07:00
parent 2d43ef9a1e
commit d16905313e
3 changed files with 21 additions and 12 deletions

20
zsh/func/init-unix-env Normal file
View file

@ -0,0 +1,20 @@
# Eryn Wells <eryn@erynwells.me>
autoload -Uz binary_exists
function init-unix-env
{
export PAGER="less"
export MANPAGER=$PAGER
export VISUAL=$EDITOR
export LESSHISTFILE="-"
export GREP_OPTIONS="--color=auto"
export GREP_COLOR="1;32"
if binary_exists gpg2; then
# Make sure gpg2 knows what to do with the curses-based smartcard PIN prompt.
export GPG_TTY=`tty`
fi
}
init-unix-env "$@"

View file

@ -1,11 +0,0 @@
# Eryn Wells <eryn@erynwells.me>
export PAGER="less"
export MANPAGER=$PAGER
export VISUAL=$EDITOR
export LESSHISTFILE="-"
export GREP_OPTIONS="--color=auto"
export GREP_COLOR="1;32"
# Make sure gpg2 knows what to do with the curses-based smartcard PIN prompt.
export GPG_TTY=`tty`

2
zshenv
View file

@ -23,7 +23,7 @@ autoload -Uz do_init_functions
typeset -a zsh_init_env_functions=( \
init-path \
init_system_parameters \
init_env \
init-unix-env \
init_env_aliases \
init_env_python \
init_env_playdate \