Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 7 additions & 8 deletions instantshell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
;;
Expand All @@ -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")

Copilot AI Sep 7, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The update operation runs both zimfw update and zimfw upgrade sequentially. Consider clarifying the purpose of each command in a comment, as the distinction between 'update' and 'upgrade' in zim context may not be immediately clear to maintainers.

Suggested change
"update")
"update")
# Run both 'zimfw update' (to update plugins and themes) and 'zimfw upgrade' (to update the Zim framework itself).

Copilot uses AI. Check for mistakes.
[ -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
1 change: 0 additions & 1 deletion zimrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ zmodule zsh-users/zsh-syntax-highlighting

zmodule Aloxaf/fzf-tab

zmodule /usr/share/instantshell/instantos.plugin.zsh
32 changes: 20 additions & 12 deletions zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Copilot AI Sep 7, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The source "${ZIM_HOME}/init.zsh" command is executed outside the install_zim_plugins() function, but ZIM_HOME may not be set. This could cause the script to fail if ZIM_HOME is undefined. Consider setting a default value for ZIM_HOME or moving this line inside the function where the zim installation logic handles the variable.

Suggested change
source "${ZIM_HOME}/init.zsh"

Copilot uses AI. Check for mistakes.
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
Expand Down