From 0894a4957e418d6567173939f5744b152c08c4e1 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 22 Jan 2022 09:03:43 -0800 Subject: [PATCH] Revert "[zsh] Remove all the shell-log calls because they are slow af" This reverts commit 3536a9d9c20b850e3dadd681209384cc476c7317. --- zprofile | 3 +++ zsh/func/init_env | 2 ++ zsh/func/init_env_darwin | 2 ++ zsh/func/init_rc_aliases | 3 +++ zsh/func/init_rc_configure_completion | 2 ++ zsh/func/init_rc_configure_ls | 2 ++ zsh/func/init_rc_configure_prompt | 3 +++ zsh/func/init_rc_configure_zle | 3 +++ zsh/func/init_rc_darwin | 2 ++ zsh/func/init_zsh_functions | 2 ++ zsh/func/init_zsh_history | 2 ++ zsh/func/init_zsh_options | 2 ++ zsh/func/load_module | 2 ++ zshrc | 2 ++ 14 files changed, 32 insertions(+) diff --git a/zprofile b/zprofile index 122f2cb..0646044 100644 --- a/zprofile +++ b/zprofile @@ -1,8 +1,11 @@ #!/usr/bin/env zsh # Eryn Wells +shell-log 'Initializing Login Environment' + # Start SSH agent for password-less logins if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then + print_info -l 1 'Starting ssh-agent' eval `ssh-agent -s` trap "kill $SSH_AGENT_PID" 0 fi diff --git a/zsh/func/init_env b/zsh/func/init_env index 3cadb17..c3d576f 100644 --- a/zsh/func/init_env +++ b/zsh/func/init_env @@ -4,6 +4,8 @@ function init_env { + shell-log 'Initializing basic environment' + export PAGER="less" export MANPAGER=$PAGER export EDITOR="vim" diff --git a/zsh/func/init_env_darwin b/zsh/func/init_env_darwin index 296aac6..e7448b1 100644 --- a/zsh/func/init_env_darwin +++ b/zsh/func/init_env_darwin @@ -7,6 +7,8 @@ autoload prepend_to_path function init_env_darwin { + shell-log "Initializing Darwin environment" + export OSBUILD=`sysctl -n kern.osversion` export OSVERSION=`sysctl -n kern.osproductversion` export HWMODEL=`sysctl -n hw.model` diff --git a/zsh/func/init_rc_aliases b/zsh/func/init_rc_aliases index ffc2ca8..eeae9fb 100644 --- a/zsh/func/init_rc_aliases +++ b/zsh/func/init_rc_aliases @@ -5,6 +5,8 @@ autoload binary_exists function init_rc_aliases { + shell-log -l 'debug' "Setting up shell aliases" + alias j='jobs' alias h='history' alias df='df -h' @@ -26,6 +28,7 @@ function init_rc_aliases binary_exists ledger && alias l='ledger' binary_exists gpg2 && alias gpg='gpg2' + shell-log -l debug 'Setting up suffix aliases' alias -s c='vim' alias -s tex='vim' alias -s txt='vim' diff --git a/zsh/func/init_rc_configure_completion b/zsh/func/init_rc_configure_completion index d967133..c38f6fb 100644 --- a/zsh/func/init_rc_configure_completion +++ b/zsh/func/init_rc_configure_completion @@ -3,6 +3,8 @@ function init_rc_configure_completion { + shell-log 'Initializing completion system' + autoload -U compinit compinit diff --git a/zsh/func/init_rc_configure_ls b/zsh/func/init_rc_configure_ls index 0f70d4d..1d08c35 100644 --- a/zsh/func/init_rc_configure_ls +++ b/zsh/func/init_rc_configure_ls @@ -19,6 +19,7 @@ function init_configure_ls ls_options='-G' fi + shell-log -l debug "Setting up aliases for $1" alias ls="$1 $ls_options" alias la="$1 -A $ls_options" alias ll="$1 -l $ls_options" @@ -32,6 +33,7 @@ function init_configure_ls dircolors="$HOME/.dircolors/default.cfg" fi + shell-log -l debug "Setting up dircolors: `basename $dircolors`" eval `$dircolors_bin $dircolors` fi } diff --git a/zsh/func/init_rc_configure_prompt b/zsh/func/init_rc_configure_prompt index b96eb41..14c411c 100644 --- a/zsh/func/init_rc_configure_prompt +++ b/zsh/func/init_rc_configure_prompt @@ -8,6 +8,8 @@ function init_rc_configure_prompt theme=loquacious fi + shell-log -l debug 'Configuring vcs_info' + autoload -U add-zsh-hook autoload -Uz vcs_info @@ -26,6 +28,7 @@ function init_rc_configure_prompt add-zsh-hook precmd export_gitbranch + shell-log "Configuring prompt with '$theme' theme" autoload -U promptinit promptinit prompt $theme diff --git a/zsh/func/init_rc_configure_zle b/zsh/func/init_rc_configure_zle index c40ff37..e535898 100644 --- a/zsh/func/init_rc_configure_zle +++ b/zsh/func/init_rc_configure_zle @@ -3,6 +3,8 @@ function init_rc_configure_zle { + shell-log 'Configuring ZLE' + local mode=$1 if [[ -z "$mode" ]]; then mode=emacs @@ -11,6 +13,7 @@ function init_rc_configure_zle function configure_zle_emacs { } function configure_zle_vim { } + shell-log -l debug "Using $mode command line editing mode" if [[ $mode == 'vim' ]]; then bindkey -v configure_zle_vim diff --git a/zsh/func/init_rc_darwin b/zsh/func/init_rc_darwin index 06a7177..bd29e3a 100644 --- a/zsh/func/init_rc_darwin +++ b/zsh/func/init_rc_darwin @@ -5,6 +5,8 @@ autoload binary_exists function init_rc_darwin { + shell-log 'Initializing Interactive Environment for macOS' + alias acls='command ls -le' # These things might have been installed by Homebrew, and I like the GNU diff --git a/zsh/func/init_zsh_functions b/zsh/func/init_zsh_functions index 9e0486f..60f90dc 100644 --- a/zsh/func/init_zsh_functions +++ b/zsh/func/init_zsh_functions @@ -7,6 +7,7 @@ function init_zsh_functions { local myfpath="$HOME/.zsh/func" + shell-log "Loading functions in $myfpath" for func in $myfpath/*; do [[ ! -e "$func" || -d "$func" ]] && continue @@ -14,6 +15,7 @@ function init_zsh_functions [[ "$functionName" =~ "prompt_*" ]] && continue [[ "$functionName" =~ "init_*" ]] && continue + shell-log -l debug "Loading $functionName" autoload +X $functionName done diff --git a/zsh/func/init_zsh_history b/zsh/func/init_zsh_history index ad07940..63d22f0 100644 --- a/zsh/func/init_zsh_history +++ b/zsh/func/init_zsh_history @@ -3,6 +3,8 @@ function init_zsh_history { + shell-log 'Setting up history' + setopt \ APPEND_HISTORY \ EXTENDED_HISTORY \ diff --git a/zsh/func/init_zsh_options b/zsh/func/init_zsh_options index 127f842..dfc8aaf 100644 --- a/zsh/func/init_zsh_options +++ b/zsh/func/init_zsh_options @@ -3,6 +3,8 @@ function init_zsh_options { + shell-log 'Setting shell options' + # Report seconds since shell was invoked in milliseconds typeset -F SECONDS diff --git a/zsh/func/load_module b/zsh/func/load_module index 31aaa7b..21e9bad 100644 --- a/zsh/func/load_module +++ b/zsh/func/load_module @@ -19,7 +19,9 @@ function load_module fpath+=($modpath) + shell-log "Loading module: $mod" for func in `ls $modpath`; do + shell-log "Loading function: $func" autoload $func done diff --git a/zshrc b/zshrc index 600d0af..4f536d9 100644 --- a/zshrc +++ b/zshrc @@ -1,6 +1,8 @@ #!/usr/bin/env zsh # Eryn Wells +shell-log 'Initializing Interactive Environment' + autoload +X init_app_environments autoload +X init_rc_aliases autoload +X init_rc_configure_completion