[zsh] Remove arguments from these init functions
This commit is contained in:
		
							parent
							
								
									e8aae4ef89
								
							
						
					
					
						commit
						b82c83073c
					
				
					 3 changed files with 21 additions and 31 deletions
				
			
		| 
						 | 
				
			
			@ -1,14 +1,11 @@
 | 
			
		|||
#!/usr/bin/env zsh
 | 
			
		||||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 | 
			
		||||
local system_ls=`which ls`
 | 
			
		||||
local has_gnu_ls
 | 
			
		||||
local ls_options
 | 
			
		||||
 | 
			
		||||
if [[ ! -e "$1" ]]; then
 | 
			
		||||
    return
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if $1 --version 2>&1 | grep GNU 1>/dev/null; then
 | 
			
		||||
if $system_ls --version 2>&1 | grep GNU 1>/dev/null; then
 | 
			
		||||
    has_gnu_ls=1
 | 
			
		||||
    ls_options='--color=auto'
 | 
			
		||||
else
 | 
			
		||||
| 
						 | 
				
			
			@ -16,10 +13,10 @@ else
 | 
			
		|||
    ls_options='-G'
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
alias ls="$1 $ls_options"
 | 
			
		||||
alias la="$1 -A $ls_options"
 | 
			
		||||
alias ll="$1 -l $ls_options"
 | 
			
		||||
alias l.="$1 -d $ls_options .*"
 | 
			
		||||
alias ls="$system_ls $ls_options"
 | 
			
		||||
alias la="$system_ls -A $ls_options"
 | 
			
		||||
alias ll="$system_ls -l $ls_options"
 | 
			
		||||
alias l.="$system_ls -d $ls_options .*"
 | 
			
		||||
 | 
			
		||||
local dircolors_bin=`whence -p dircolors || whence -p gdircolors`
 | 
			
		||||
if [[ $has_gnu_ls -eq 1 && -n "$dircolors_bin" ]]; then
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,10 +1,7 @@
 | 
			
		|||
#!/usr/bin/env zsh
 | 
			
		||||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 | 
			
		||||
local theme=$1
 | 
			
		||||
if [[ -z "$1" ]]; then
 | 
			
		||||
    theme=loquacious
 | 
			
		||||
fi
 | 
			
		||||
local theme=loquacious
 | 
			
		||||
 | 
			
		||||
autoload -U add-zsh-hook
 | 
			
		||||
autoload -Uz vcs_info
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,24 +1,20 @@
 | 
			
		|||
#!/usr/bin/env zsh
 | 
			
		||||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 | 
			
		||||
function init_rc_configure_zle
 | 
			
		||||
{
 | 
			
		||||
    local mode=$1
 | 
			
		||||
    if [[ -z "$mode" ]]; then
 | 
			
		||||
        mode=emacs
 | 
			
		||||
    fi
 | 
			
		||||
local mode=emacs
 | 
			
		||||
 | 
			
		||||
    function configure_zle_emacs { }
 | 
			
		||||
    function configure_zle_vim { }
 | 
			
		||||
if [[ -z "$mode" ]]; then
 | 
			
		||||
    mode=emacs
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
    if [[ $mode == 'vim' ]]; then
 | 
			
		||||
        bindkey -v
 | 
			
		||||
        configure_zle_vim
 | 
			
		||||
        zle -A .backward-delete-char vi-backward-delete-char
 | 
			
		||||
    elif [[ $mode == 'emacs' ]]; then
 | 
			
		||||
        bindkey -e
 | 
			
		||||
        configure_zle_emacs
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
function configure_zle_emacs { }
 | 
			
		||||
function configure_zle_vim { }
 | 
			
		||||
 | 
			
		||||
init_rc_configure_zle "$@"
 | 
			
		||||
if [[ $mode == 'vim' ]]; then
 | 
			
		||||
    bindkey -v
 | 
			
		||||
    configure_zle_vim
 | 
			
		||||
    zle -A .backward-delete-char vi-backward-delete-char
 | 
			
		||||
elif [[ $mode == 'emacs' ]]; then
 | 
			
		||||
    bindkey -e
 | 
			
		||||
    configure_zle_emacs
 | 
			
		||||
fi
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue