Move zsh startup files to the dotfiles role
This commit is contained in:
		
							parent
							
								
									74196601f6
								
							
						
					
					
						commit
						ae514e9a07
					
				
					 3 changed files with 0 additions and 0 deletions
				
			
		
							
								
								
									
										9
									
								
								Ansible/roles/dotfiles/files/zsh/zprofile
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								Ansible/roles/dotfiles/files/zsh/zprofile
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 | 
			
		||||
zsh_init_profile_functions=( \
 | 
			
		||||
    connect_ssh_agent \
 | 
			
		||||
    init_profile_$SYS \
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
do_init_functions zsh_init_profile_functions
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										40
									
								
								Ansible/roles/dotfiles/files/zsh/zshenv
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								Ansible/roles/dotfiles/files/zsh/zshenv
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,40 @@
 | 
			
		|||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 | 
			
		||||
# Don't read global startup. It messes things up...
 | 
			
		||||
unsetopt GLOBAL_RCS
 | 
			
		||||
 | 
			
		||||
export SYS=`uname -s | tr A-Z a-z`
 | 
			
		||||
 | 
			
		||||
function init-env-fpath
 | 
			
		||||
{
 | 
			
		||||
    local -r fpath_candidates=( \
 | 
			
		||||
        "$HOME/.zsh/${SYS}-functions" \
 | 
			
		||||
        "$HOME/.zsh/func" \
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    # Process the array in reverse order (`Oa` means "descending index order",
 | 
			
		||||
    # in other worse "reverse order"; see PARAMETER EXPANSION section of the man
 | 
			
		||||
    # pages) so the paths are prepended in the correct order.
 | 
			
		||||
    for candidate in ${(Oa)fpath_candidates}; do
 | 
			
		||||
        if [[ ! -d "$candidate" ]]; then
 | 
			
		||||
            continue
 | 
			
		||||
        fi
 | 
			
		||||
        fpath=($candidate $fpath)
 | 
			
		||||
    done
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
init-env-fpath
 | 
			
		||||
 | 
			
		||||
autoload -Uz do_init_functions
 | 
			
		||||
 | 
			
		||||
typeset -a zsh_init_env_functions=( \
 | 
			
		||||
    init-env \
 | 
			
		||||
    init-env-path \
 | 
			
		||||
    init-env-tilde-paths \
 | 
			
		||||
    init-env-python \
 | 
			
		||||
    init-env-playdate \
 | 
			
		||||
    init-env-vi \
 | 
			
		||||
    init-env-$SYS \
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
do_init_functions zsh_init_env_functions
 | 
			
		||||
							
								
								
									
										30
									
								
								Ansible/roles/dotfiles/files/zsh/zshrc
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								Ansible/roles/dotfiles/files/zsh/zshrc
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,30 @@
 | 
			
		|||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 | 
			
		||||
zsh_init_rc_functions=( \
 | 
			
		||||
    init_rc_fpath_darwin \
 | 
			
		||||
    init_rc_aliases \
 | 
			
		||||
    init_configure_ls \
 | 
			
		||||
    init_rc_tilde_paths \
 | 
			
		||||
    init_rc_configure_prompt \
 | 
			
		||||
    init_rc_configure_zle \
 | 
			
		||||
    init_rc_configure_completion \
 | 
			
		||||
    init_zsh_options \
 | 
			
		||||
    init_zsh_history \
 | 
			
		||||
    init_app_environments \
 | 
			
		||||
    init-rc-$SYS \
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
if [[ -o LOGIN ]]; then
 | 
			
		||||
    zsh_init_rc_functions+=(
 | 
			
		||||
        list_tmux_sessions \
 | 
			
		||||
    )
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
do_init_functions zsh_init_rc_functions
 | 
			
		||||
 | 
			
		||||
autoload -Uz g
 | 
			
		||||
autoload -Uz nethack
 | 
			
		||||
autoload -Uz pw
 | 
			
		||||
autoload -Uz up
 | 
			
		||||
autoload -Uz vi
 | 
			
		||||
autoload -Uz homebrew-prefix
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue