[zsh] Remove arguments from these init functions

This commit is contained in:
Eryn Wells 2022-05-25 17:02:26 -07:00
parent e8aae4ef89
commit b82c83073c
3 changed files with 21 additions and 31 deletions

View file

@ -1,14 +1,11 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me> # Eryn Wells <eryn@erynwells.me>
local system_ls=`which ls`
local has_gnu_ls local has_gnu_ls
local ls_options local ls_options
if [[ ! -e "$1" ]]; then if $system_ls --version 2>&1 | grep GNU 1>/dev/null; then
return
fi
if $1 --version 2>&1 | grep GNU 1>/dev/null; then
has_gnu_ls=1 has_gnu_ls=1
ls_options='--color=auto' ls_options='--color=auto'
else else
@ -16,10 +13,10 @@ else
ls_options='-G' ls_options='-G'
fi fi
alias ls="$1 $ls_options" alias ls="$system_ls $ls_options"
alias la="$1 -A $ls_options" alias la="$system_ls -A $ls_options"
alias ll="$1 -l $ls_options" alias ll="$system_ls -l $ls_options"
alias l.="$1 -d $ls_options .*" alias l.="$system_ls -d $ls_options .*"
local dircolors_bin=`whence -p dircolors || whence -p gdircolors` local dircolors_bin=`whence -p dircolors || whence -p gdircolors`
if [[ $has_gnu_ls -eq 1 && -n "$dircolors_bin" ]]; then if [[ $has_gnu_ls -eq 1 && -n "$dircolors_bin" ]]; then

View file

@ -1,10 +1,7 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me> # Eryn Wells <eryn@erynwells.me>
local theme=$1 local theme=loquacious
if [[ -z "$1" ]]; then
theme=loquacious
fi
autoload -U add-zsh-hook autoload -U add-zsh-hook
autoload -Uz vcs_info autoload -Uz vcs_info

View file

@ -1,9 +1,8 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me> # Eryn Wells <eryn@erynwells.me>
function init_rc_configure_zle local mode=emacs
{
local mode=$1
if [[ -z "$mode" ]]; then if [[ -z "$mode" ]]; then
mode=emacs mode=emacs
fi fi
@ -19,6 +18,3 @@ function init_rc_configure_zle
bindkey -e bindkey -e
configure_zle_emacs configure_zle_emacs
fi fi
}
init_rc_configure_zle "$@"