Add more update functions to zsh

This commit is contained in:
alvinlollo
2026-03-07 16:10:41 +11:00
parent 12441a025e
commit 8307e84c27
+22 -5
View File
@@ -84,9 +84,9 @@ source $ZSH/oh-my-zsh.sh
# Preferred editor for local and remote sessions # Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='nvim'
else
export EDITOR='vim' export EDITOR='vim'
else
export EDITOR='nvim'
fi fi
# Compilation flags # Compilation flags
@@ -100,7 +100,15 @@ update () {
# Update arch based systems with yay AUR helper # Update arch based systems with yay AUR helper
if command -v pacman >/dev/null && command -v yay >/dev/null; then if command -v pacman >/dev/null && command -v yay >/dev/null; then
echo "✅ 'pacman' and 'yay' found. Updating." echo "✅ 'pacman' and 'yay' found. Updating."
sudo pacman -Syu && yay -Syu sudo pacman -Syu --noconfirm && yay -Syu --save --answerclean None --answerdiff None --noconfirm
elif command -v pacman >/dev/null; then
echo "✅ 'pacman' found. Updating."
sudo pacman -Syu --noconfirm
if
if command -v paru >/dev/null; then
echo "✅ 'flatpak' found. Updating."
paru -Syu
fi fi
# Update on debian based systems # Update on debian based systems
@@ -122,6 +130,13 @@ update () {
flatpak update -y flatpak update -y
fi fi
# Update npm
if command -v npm >/dev/null; then
echo "✅ 'npm' found. Updating."
sudo npm install -g npm-check-updates
fi
omz update omz update
} }
@@ -149,8 +164,9 @@ sudo-last-command-execute() {
bindkey '^U' sudo-last-command-execute bindkey '^U' sudo-last-command-execute
# Ydotool # Ydotool
export YDOTOOL_SOCKET=/tmp/.ydotool_socket if [[ -f "/tmp/.ydotool_socket" ]]; then
export YDOTOOL_SOCKET=/tmp/.ydotool_socket
fi
# Set personal aliases, overriding those provided by oh-my-zsh libs, # Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh # plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder. # users are encouraged to define aliases within the ZSH_CUSTOM folder.
@@ -160,3 +176,4 @@ export YDOTOOL_SOCKET=/tmp/.ydotool_socket
# alias zshconfig="mate ~/.zshrc" # alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh" # alias ohmyzsh="mate ~/.oh-my-zsh"
alias edit="nvim"