diff --git a/frameworks/antibody-static.zsh b/frameworks/antibody-static.zsh index 0bf77d7..2fa0df4 100644 --- a/frameworks/antibody-static.zsh +++ b/frameworks/antibody-static.zsh @@ -1,10 +1,7 @@ -() { -local -r home_dir=${1} - # install antibody -[[ ! -e ${home_dir}/bin/antibody ]] && command curl -sL git.io/antibody | sh -s - -b ${home_dir}/bin +[[ ! -e bin/antibody ]] && command curl -sL git.io/antibody | sh -s - -b bin ->>! ${home_dir}/.zsh_plugins.txt <<\END +>>! .zsh_plugins.txt <<\END zimfw/environment zimfw/git zimfw/input @@ -20,9 +17,9 @@ zsh-users/zsh-syntax-highlighting zsh-users/zsh-history-substring-search END -HOME=${home_dir} ANTIBODY_HOME=${home_dir}/.antibody ${home_dir}/bin/antibody bundle < ${home_dir}/.zsh_plugins.txt > ${home_dir}/.zsh_plugins.sh +HOME=${PWD} ANTIBODY_HOME=${PWD}/.antibody bin/antibody bundle < .zsh_plugins.txt > .zsh_plugins.sh ->>! ${home_dir}/.zshrc <<\END +>>! .zshrc <<\END export ANTIBODY_HOME=~/.antibody # antibody does not add functions subdirs to fpath, nor autoloads them! @@ -34,4 +31,3 @@ source ~/.zsh_plugins.sh bindkey "^[[A" history-substring-search-up bindkey "^[[B" history-substring-search-down END -} "${@}" diff --git a/frameworks/antigen.zsh b/frameworks/antigen.zsh index 1dbd5d1..7b57e36 100644 --- a/frameworks/antigen.zsh +++ b/frameworks/antigen.zsh @@ -1,11 +1,8 @@ -() { -local -r home_dir=${1} - -# download the repository -command curl -Ss -L git.io/antigen > ${home_dir}/antigen.zsh +# download the script +command curl -Ss -L git.io/antigen > antigen.zsh # add modules to .zshrc ->>! ${home_dir}/.zshrc <<\END +>>! .zshrc <<\END source ~/antigen.zsh antigen bundle zimfw/environment antigen bundle zimfw/git @@ -30,5 +27,4 @@ bindkey "^[[B" history-substring-search-down END # Force reinstall, as it was failing in alpine linux -HOME=${home_dir} zsh -ic 'antigen reset' -} "${@}" +HOME=${PWD} zsh -ic 'antigen reset' diff --git a/frameworks/ohmyzsh.zsh b/frameworks/ohmyzsh.zsh index cd049dd..8835fb4 100644 --- a/frameworks/ohmyzsh.zsh +++ b/frameworks/ohmyzsh.zsh @@ -1,22 +1,18 @@ -() { -local -r home_dir=${1} - # download the install script -command curl -sS -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh >${home_dir}/install.sh +command curl -sS -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh > install.sh # also remove the automatic-start of the new terminal # silence the git clone output -command sed -i.bak -e '/env zsh -l/d' -e 's/git clone/git clone --quiet/g' ${home_dir}/install.sh +command sed -i.bak -e '/env zsh -l/d' -e 's/git clone/git clone --quiet/g' install.sh # run though sh as per the instructions -HOME=${home_dir} ZSH=${home_dir}/.oh-my-zsh sh ${home_dir}/install.sh --unattended +HOME=${PWD} ZSH=${PWD}/.oh-my-zsh sh install.sh --unattended # grab zsh-syntax-highlighting -command git clone --quiet https://github.com/zsh-users/zsh-autosuggestions ${home_dir}/.oh-my-zsh/custom/plugins/zsh-autosuggestions +command git clone --quiet https://github.com/zsh-users/zsh-autosuggestions .oh-my-zsh/custom/plugins/zsh-autosuggestions # grab zsh-syntax-highlighting -command git clone --quiet https://github.com/zsh-users/zsh-syntax-highlighting.git ${home_dir}/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting +command git clone --quiet https://github.com/zsh-users/zsh-syntax-highlighting.git .oh-my-zsh/custom/plugins/zsh-syntax-highlighting # we don't need auto-update stuff # replace the plugin string with the selected plugins -command sed -i.bak -E -e 's/^# (DISABLE_AUTO_UPDATE="true")/\1/' -e 's/^(plugins=\([^\)]*)/\1 git-prompt colored-man-pages common-aliases timer zsh-autosuggestions zsh-syntax-highlighting history-substring-search/' ${home_dir}/.zshrc -} "${@}" +command sed -i.bak -E -e 's/^# (DISABLE_AUTO_UPDATE="true")/\1/' -e 's/^(plugins=\([^\)]*)/\1 git-prompt colored-man-pages common-aliases timer zsh-autosuggestions zsh-syntax-highlighting history-substring-search/' .zshrc diff --git a/frameworks/prezto.zsh b/frameworks/prezto.zsh index e65ab4d..a7d8a3a 100644 --- a/frameworks/prezto.zsh +++ b/frameworks/prezto.zsh @@ -1,21 +1,17 @@ -() { -local -r home_dir=${1} - -# download the repository -command git clone --quiet --recursive https://github.com/sorin-ionescu/prezto.git "${home_dir}/.zprezto" +# clone the repository +command git clone --quiet --recursive https://github.com/sorin-ionescu/prezto.git .zprezto # follow the install instructions setopt LOCAL_OPTIONS EXTENDED_GLOB local rcfile -for rcfile in "${home_dir}"/.zprezto/runcoms/^README.md(.N); do - command ln -s "${rcfile}" "${home_dir}/.${rcfile:t}" +for rcfile in .zprezto/runcoms/^README.md(.N); do + command ln -s "${rcfile}" ".${rcfile:t}" done # add the modules to the .zpreztorc file -command rm -f ${home_dir}/.zpreztorc -command cp ${home_dir}/.zprezto/runcoms/zpreztorc ${home_dir}/.zpreztorc -command sed -i.bak -E -e "/^ *'spectrum' \\\\/d" -e "s/^( *'prompt')/\\1 'git' 'autosuggestions' 'syntax-highlighting' 'history-substring-search'/" ${home_dir}/.zpreztorc +command rm -f .zpreztorc +command cp .zprezto/runcoms/zpreztorc .zpreztorc +command sed -i.bak -E -e "/^ *'spectrum' \\\\/d" -e "s/^( *'prompt')/\\1 'git' 'autosuggestions' 'syntax-highlighting' 'history-substring-search'/" .zpreztorc # start login shell -HOME=${home_dir} zsh -lc 'exit' -} "${@}" +HOME=${PWD} zsh -lc 'exit' diff --git a/frameworks/vanilla.zsh b/frameworks/vanilla.zsh index a165feb..2e53efd 100644 --- a/frameworks/vanilla.zsh +++ b/frameworks/vanilla.zsh @@ -1,8 +1,4 @@ -() { -local -r home_dir=${1} - # just set PS1 ->>! ${home_dir}/.zshrc <<\END +>>! .zshrc <<\END PS1="%~%# " END -} "${@}" diff --git a/frameworks/zcomet.zsh b/frameworks/zcomet.zsh index d65823c..63da3a9 100644 --- a/frameworks/zcomet.zsh +++ b/frameworks/zcomet.zsh @@ -1,11 +1,9 @@ -() { -local -r home_dir=${1} - -git clone https://github.com/agkozak/zcomet.git ${home_dir} +# clone the repository +git clone https://github.com/agkozak/zcomet.git .zcomet/bin # add modules to .zshrc ->! ${home_dir}/.zshrc <<\END -source ~/zcomet.zsh +>! .zshrc <<\END +source ~/.zcomet/bin/zcomet.zsh zcomet load zimfw/environment zcomet load zimfw/git zcomet load zimfw/input @@ -24,5 +22,3 @@ zcomet load zsh-users/zsh-history-substring-search bindkey "^[[A" history-substring-search-up bindkey "^[[B" history-substring-search-down END - -} "${@}" diff --git a/frameworks/zgen.zsh b/frameworks/zgen.zsh index 37fc06b..952a554 100644 --- a/frameworks/zgen.zsh +++ b/frameworks/zgen.zsh @@ -1,11 +1,8 @@ -() { -local -r home_dir=${1} - -# download the repository -command git clone --quiet https://github.com/tarjoilija/zgen.git ${home_dir}/.zgen +# clone the repository +command git clone --quiet https://github.com/tarjoilija/zgen.git .zgen # add modules to .zshrc ->>! ${home_dir}/.zshrc <<\END +>>! .zshrc <<\END ZGEN_AUTOLOAD_COMPINIT=0 # zgen does not add functions subdirs to fpath, nor autoloads them! @@ -33,4 +30,3 @@ fi bindkey "^[[A" history-substring-search-up bindkey "^[[B" history-substring-search-down END -} "${@}" diff --git a/frameworks/zim.zsh b/frameworks/zim.zsh index fbedf12..60f7810 100644 --- a/frameworks/zim.zsh +++ b/frameworks/zim.zsh @@ -1,6 +1,2 @@ -() { -local -r home_dir=${1} - -# download the repository -command curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | HOME=${home_dir} zsh -} "${@}" +# download the install script +command curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | HOME=${PWD} zsh diff --git a/frameworks/zinit-light.zsh b/frameworks/zinit-light.zsh index b15a25c..7bf6d39 100644 --- a/frameworks/zinit-light.zsh +++ b/frameworks/zinit-light.zsh @@ -1,12 +1,8 @@ -() { -local -r home_dir=${1} - -# download the repository -command mkdir ${home_dir}/.zinit -command git clone --quiet https://github.com/zdharma-continuum/zinit.git ${home_dir}/.zinit/bin +# clone the repository +command git clone --quiet https://github.com/zdharma-continuum/zinit.git .zinit/bin # add modules to .zshrc ->>! ${home_dir}/.zshrc <<\END +>>! .zshrc <<\END PS1="%~%# " source ~/.zinit/bin/zinit.zsh zinit light "zimfw/environment" @@ -37,5 +33,4 @@ bindkey "^[[B" history-substring-search-down END # compile the plugins -HOME=${home_dir} zsh -ic 'zinit compile --all; exit' -} "${@}" +HOME=${PWD} zsh -ic 'zinit compile --all; exit' diff --git a/frameworks/zinit-turbo.zsh b/frameworks/zinit-turbo.zsh index 77762ea..f674c57 100644 --- a/frameworks/zinit-turbo.zsh +++ b/frameworks/zinit-turbo.zsh @@ -1,12 +1,8 @@ -() { -local -r home_dir=${1} - -# download the repository -command mkdir ${home_dir}/.zinit -command git clone --quiet https://github.com/zdharma-continuum/zinit.git ${home_dir}/.zinit/bin +# clone the repository +command git clone --quiet https://github.com/zdharma-continuum/zinit.git .zinit/bin # add modules to .zshrc ->>! ${home_dir}/.zshrc <<\END +>>! .zshrc <<\END source ~/.zinit/bin/zinit.zsh zinit wait lucid for "zimfw/environment" zinit wait lucid autoload"git-alias-lookup;git-branch-current;git-branch-delete-interactive;git-branch-remote-tracking;git-dir;git-ignore-add;git-root;git-stash-clear-interactive;git-stash-recover;git-submodule-move;git-submodule-remove" for "zimfw/git" @@ -23,5 +19,4 @@ zinit wait"0c" lucid atload"zicompinit;zicdreplay;bindkey \"^[[A\" history-subst END # compile the plugins -HOME=${home_dir} zsh -ic 'zinit compile --all; exit' -} "${@}" +HOME=${PWD} zsh -ic 'zinit compile --all; exit' diff --git a/frameworks/zplug.zsh b/frameworks/zplug.zsh index 3b47d6a..403022b 100644 --- a/frameworks/zplug.zsh +++ b/frameworks/zplug.zsh @@ -1,11 +1,8 @@ -() { -local -r home_dir=${1} - -# download the repository -command git clone --quiet https://github.com/zplug/zplug ${home_dir}/.zplug +# clone the repository +command git clone --quiet https://github.com/zplug/zplug .zplug # add modules to .zshrc ->>! ${home_dir}/.zshrc <<\END +>>! .zshrc <<\END source ~/.zplug/init.zsh zplug "zimfw/environment" zplug "zimfw/git" @@ -27,5 +24,4 @@ fi END # install the plugins -HOME=${home_dir} zsh -ic 'zplug install; exit' -} "${@}" +HOME=${PWD} zsh -ic 'zplug install; exit' diff --git a/frameworks/zsh4humans.zsh b/frameworks/zsh4humans.zsh index 47a9dc5..641a262 100644 --- a/frameworks/zsh4humans.zsh +++ b/frameworks/zsh4humans.zsh @@ -1,7 +1,4 @@ -( - emulate -L zsh -o err_return -o no_unset -o no_aliases -cd -- $1 # download zsh4humans v5 local v=5 curl -fsSLO https://github.com/romkatv/zsh4humans/archive/refs/heads/v${v}.tar.gz @@ -23,5 +20,3 @@ mkdir -p .cache/zsh4humans/v5/stickycache touch .cache/zsh4humans/v5/stickycache/no-chsh # initialize zsh4humans HOME=${PWD} zsh -ic 'exit'