diff --git a/README.md b/README.md index 50afd25..c7924cd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ zsh configuration for instantOS -A modern [antidote](https://github.com/mattmc3/antidote) based shell configuration with sensible defaults +A modern [zim](https://github.com/zimfw/zimfw) based shell configuration with sensible defaults. ## Installation diff --git a/instantshell.sh b/instantshell.sh index a0cf32f..bb09020 100755 --- a/instantshell.sh +++ b/instantshell.sh @@ -14,9 +14,8 @@ zshrun() { case "$1" in "install") - [ -e "$HOME"/.cache/antidote ] || mkdir -p ~/.cache/antidote/ echo "source /usr/share/instantshell/zshrc" >~/.zshrc - zshrun "install_antidote_plugins" || exit 1 + zshrun "install_zim_plugins" || exit 1 zshrun "echo 'installing'" || exit 1 echo "instantSHELL installation complete" ;; @@ -28,27 +27,27 @@ uninstall) if [ "$2" = "-f" ]; then CONFIRMATION="y" else - echo -n "this will clear your entire zsh configuration. Continue? (y/n) " + echo -n "this will clear your entire zsh and zim configuration. Continue? (y/n) " read -r CONFIRMATION echo "" fi if [ "$CONFIRMATION" = "y" ]; then [ -e ~/.zshrc ] && rm ~/.zshrc - [ -e ~/.cache/antidote/ ] && rm -rf ~/.cache/antidote/ + [ -e ~/.zimrc ] && rm ~/.zimrc + [ -e ~/.zim/ ] && rm -rf ~/.zim/ else exit 1 fi ;; "update") - [ -e "$HOME"/.cache/antidote ] && mkdir -p ~/.cache/antidote/ - zshrun "iantidote; antidote update" - zshrun "iantidote; antidote bundle < /usr/share/instantshell/bundle.txt > ~/.zsh_plugins.sh " + zshrun "zimfw update" || exit 1 + zshrun "zimfw upgrade" || exit 1 ;; *) echo "usage: instantshell [COMMAND] install install all instantSHELL dotfiles reinstall remove and install all instantSHELL dotfiles uninstall remove instantSHELL dotfiles - update update zsh plugins" + update update zsh plugins and zim manager" ;; esac diff --git a/zimrc b/zimrc index 348dd5d..1b49413 100644 --- a/zimrc +++ b/zimrc @@ -13,4 +13,3 @@ zmodule zsh-users/zsh-syntax-highlighting zmodule Aloxaf/fzf-tab -zmodule /usr/share/instantshell/instantos.plugin.zsh diff --git a/zshrc b/zshrc index 03ad672..df7c187 100755 --- a/zshrc +++ b/zshrc @@ -28,22 +28,30 @@ isinstantos() { command -v instantmenu &>/dev/null } -# Download zimfw plugin manager if missing. -if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then - curl -fsSL --create-dirs -o ${ZIM_HOME}/zimfw.zsh \ - https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh -fi - -# Install missing modules and update ${ZIM_HOME}/init.zsh if missing or outdated. -if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZIM_CONFIG_FILE:-${ZDOTDIR:-${HOME}}/.zimrc} ]]; then - source ${ZIM_HOME}/zimfw.zsh init -fi - -source ${ZIM_HOME}/init.zsh +install_zim_plugins() { + # Download zimfw plugin manager if missing. + if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then + curl -fsSL --create-dirs -o ${ZIM_HOME}/zimfw.zsh \ + https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh + fi + + # Install missing modules and update ${ZIM_HOME}/init.zsh if missing or outdated. + if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZIM_CONFIG_FILE:-${ZDOTDIR:-${HOME}}/.zimrc} ]]; then + source ${ZIM_HOME}/zimfw.zsh init + fi + + source "${ZIM_HOME}/init.zsh" +} +source "${ZIM_HOME}/init.zsh" export STARSHIP_CONFIG=/usr/share/instantshell/starship.toml eval "$(starship init zsh)" +# For fzf-tab to work +autoload -U compinit; compinit +# InstantOS plugin +source "/usr/share/instantshell/instantos.plugin.zsh" + export LESS='-R --use-color -Dd+r$Du+b' alias ls='ls --color=auto' alias vi=nvim