mirror of
https://github.com/alvinlollo/Single-install-script.git
synced 2026-06-14 18:59:43 +10:00
Add more update functions to zsh
This commit is contained in:
+21
-4
@@ -84,9 +84,9 @@ source $ZSH/oh-my-zsh.sh
|
||||
|
||||
# Preferred editor for local and remote sessions
|
||||
if [[ -n $SSH_CONNECTION ]]; then
|
||||
export EDITOR='nvim'
|
||||
else
|
||||
export EDITOR='vim'
|
||||
else
|
||||
export EDITOR='nvim'
|
||||
fi
|
||||
|
||||
# Compilation flags
|
||||
@@ -100,7 +100,15 @@ update () {
|
||||
# Update arch based systems with yay AUR helper
|
||||
if command -v pacman >/dev/null && command -v yay >/dev/null; then
|
||||
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
|
||||
|
||||
# Update on debian based systems
|
||||
@@ -122,6 +130,13 @@ update () {
|
||||
flatpak update -y
|
||||
fi
|
||||
|
||||
# Update npm
|
||||
if command -v npm >/dev/null; then
|
||||
echo "✅ 'npm' found. Updating."
|
||||
sudo npm install -g npm-check-updates
|
||||
fi
|
||||
|
||||
|
||||
omz update
|
||||
|
||||
}
|
||||
@@ -149,8 +164,9 @@ sudo-last-command-execute() {
|
||||
bindkey '^U' sudo-last-command-execute
|
||||
|
||||
# Ydotool
|
||||
if [[ -f "/tmp/.ydotool_socket" ]]; then
|
||||
export YDOTOOL_SOCKET=/tmp/.ydotool_socket
|
||||
|
||||
fi
|
||||
# Set personal aliases, overriding those provided by oh-my-zsh libs,
|
||||
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
|
||||
# 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 ohmyzsh="mate ~/.oh-my-zsh"
|
||||
|
||||
alias edit="nvim"
|
||||
|
||||
Reference in New Issue
Block a user