Revert "[zsh] Remove all the shell-log calls because they are slow af"
This reverts commit 3536a9d9c2.
			
			
This commit is contained in:
		
							parent
							
								
									265e239fc8
								
							
						
					
					
						commit
						0894a4957e
					
				
					 14 changed files with 32 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -4,6 +4,8 @@
 | 
			
		|||
 | 
			
		||||
function init_env
 | 
			
		||||
{
 | 
			
		||||
    shell-log 'Initializing basic environment'
 | 
			
		||||
 | 
			
		||||
    export PAGER="less"
 | 
			
		||||
    export MANPAGER=$PAGER
 | 
			
		||||
    export EDITOR="vim"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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`
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,6 +3,8 @@
 | 
			
		|||
 | 
			
		||||
function init_rc_configure_completion
 | 
			
		||||
{
 | 
			
		||||
    shell-log 'Initializing completion system'
 | 
			
		||||
 | 
			
		||||
    autoload -U compinit
 | 
			
		||||
    compinit
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,6 +3,8 @@
 | 
			
		|||
 | 
			
		||||
function init_zsh_history
 | 
			
		||||
{
 | 
			
		||||
    shell-log 'Setting up history'
 | 
			
		||||
 | 
			
		||||
    setopt \
 | 
			
		||||
        APPEND_HISTORY \
 | 
			
		||||
        EXTENDED_HISTORY \
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,6 +3,8 @@
 | 
			
		|||
 | 
			
		||||
function init_zsh_options
 | 
			
		||||
{
 | 
			
		||||
    shell-log 'Setting shell options'
 | 
			
		||||
 | 
			
		||||
    # Report seconds since shell was invoked in milliseconds
 | 
			
		||||
    typeset -F SECONDS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue