From b82c83073cbf478d823863abbb2b9484db588ba2 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 25 May 2022 17:02:26 -0700 Subject: [PATCH] [zsh] Remove arguments from these init functions --- zsh/func/init_configure_ls | 15 ++++++--------- zsh/func/init_rc_configure_prompt | 5 +---- zsh/func/init_rc_configure_zle | 32 ++++++++++++++----------------- 3 files changed, 21 insertions(+), 31 deletions(-) diff --git a/zsh/func/init_configure_ls b/zsh/func/init_configure_ls index 088b5f4..1808574 100644 --- a/zsh/func/init_configure_ls +++ b/zsh/func/init_configure_ls @@ -1,14 +1,11 @@ #!/usr/bin/env zsh # Eryn Wells +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 diff --git a/zsh/func/init_rc_configure_prompt b/zsh/func/init_rc_configure_prompt index 1c44948..669bbd4 100644 --- a/zsh/func/init_rc_configure_prompt +++ b/zsh/func/init_rc_configure_prompt @@ -1,10 +1,7 @@ #!/usr/bin/env zsh # Eryn Wells -local theme=$1 -if [[ -z "$1" ]]; then - theme=loquacious -fi +local theme=loquacious autoload -U add-zsh-hook autoload -Uz vcs_info diff --git a/zsh/func/init_rc_configure_zle b/zsh/func/init_rc_configure_zle index c40ff37..f4fc1f1 100644 --- a/zsh/func/init_rc_configure_zle +++ b/zsh/func/init_rc_configure_zle @@ -1,24 +1,20 @@ #!/usr/bin/env zsh # Eryn Wells -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