From d16905313e4a9e88f121e815e82be01f6c39c30b Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 23 Sep 2024 18:13:46 -0700 Subject: [PATCH] [zsh] Clean up and move init_env to init-unix-env --- zsh/func/init-unix-env | 20 ++++++++++++++++++++ zsh/func/init_env | 11 ----------- zshenv | 2 +- 3 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 zsh/func/init-unix-env delete mode 100644 zsh/func/init_env diff --git a/zsh/func/init-unix-env b/zsh/func/init-unix-env new file mode 100644 index 0000000..fc224e7 --- /dev/null +++ b/zsh/func/init-unix-env @@ -0,0 +1,20 @@ +# Eryn Wells + +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 "$@" diff --git a/zsh/func/init_env b/zsh/func/init_env deleted file mode 100644 index 67f7c74..0000000 --- a/zsh/func/init_env +++ /dev/null @@ -1,11 +0,0 @@ -# Eryn Wells - -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` diff --git a/zshenv b/zshenv index b35889a..7050af8 100644 --- a/zshenv +++ b/zshenv @@ -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 \