From f322dfa16a9b811045b8caa78d2541695a399d63 Mon Sep 17 00:00:00 2001 From: PieckA Date: Fri, 24 May 2024 23:13:09 +0200 Subject: [PATCH] addet fisher plugin support --- config.fish | 54 +++++++++++++++++++++++------------------ functions/c_fisher.fish | 13 ++++++++-- 2 files changed, 42 insertions(+), 25 deletions(-) diff --git a/config.fish b/config.fish index 579bd08..ac328cf 100644 --- a/config.fish +++ b/config.fish @@ -8,6 +8,7 @@ end # │ If you have any questions, check the git page at: │ # │ https://git.k4li.de/pika/fish.git │ # ╰───────────────────────────────────────────────────╯ + # ────────────────────────────────────────< sources >────────────────────────────────────── source $HOME/.config/fish/functions/git.fish source $HOME/.config/fish/functions/tmux.fish @@ -16,29 +17,36 @@ source $HOME/.config/fish/functions/c_fisher.fish # ─────────────────────────────────< Environment-Variables >─────────────────────────────── set -p EDITOR (which nvim) +# ─< check for sudo/root >────────────────────────────────────────────────────────────────── +if [ $USER == root ] + set sudo "" +else + set sudo "sudo" +end + # ─────────────────────────< START | distro/packagemanger detection >───────────────────────── # ─< DNF - Fedora >───────────────────────────────────────────────────── if command -v dnf - alias install='sudo dnf install' - alias update='sudo dnf update && sudo dnf upgrade' - alias search='sudo dnf search' - alias remove='sudo dnf remove' + alias install='$sudo dnf install' + alias update='$sudo dnf update && sudo dnf upgrade' + alias search='$sudo dnf search' + alias remove='$sudo dnf remove' set -a ALIASSES "-- You're using DNF aliases!! --" end # ─< APT/NALA - Debian >──────────────────────────────────────────────── if command -v nala >/dev/null 2>&1 - alias install='sudo nala update && sudo nala install' - alias update='sudo nala update && sudo nala upgrade' - alias search='nala search' - alias remove='sudo nala remove' + alias install='$sudo nala update && sudo nala install' + alias update='$sudo nala update && sudo nala upgrade' + alias search='$sudo nala search' + alias remove='$sudo nala remove' set ALIASSES "-- You're using NALA aliases!! --" else if command -v apt >/dev/null 2>&1 - alias install='sudo apt update && sudo apt install' - alias update='sudo apt update && sudo apt upgrade' - alias search='apt search' - alias remove='sudo apt remove' + alias install='$sudo apt update && sudo apt install' + alias update='$sudo apt update && sudo apt upgrade' + alias search='$sudo apt search' + alias remove='$sudo apt remove' set ALIASSES "-- You're using APT aliases!! --" end end @@ -59,9 +67,9 @@ if command -v paru >/dev/null 2>&1 set ALIASSES "-- You're using Arch!! - installed helper: paru --" else if command -v pacman >/dev/null 2>&1 - alias install='sudo pacman -S' - alias update='sudo pacman -Syu' - alias remove='sudo pacman -R' + alias install='$sudo pacman -S' + alias update='$sudo pacman -Syu' + alias remove='$sudo pacman -R' set ALIASSES "-- by the PACMAN - You're using Arch!! --" end end @@ -69,20 +77,20 @@ end # ─< Zypper - OpenSuse >──────────────────────────────────────────────────────────────────── if command -v zypper >/dev/null 2>&1 - alias install='sudo zypper in' - alias update='sudo zypper dup' - alias search='sudo zypper se' - alias lock='sudo zypper al' - alias remove='sudo zypper rm' + alias install='$sudo zypper in' + alias update='$sudo zypper dup' + alias search='$sudo zypper se' + alias lock='$sudo zypper al' + alias remove='$sudo zypper rm' set ALIASSES "-- I see.. you're using OpenSUSE. i like <3 -- -- ZYPPER -- " end # ─< APK - Alpine >───────────────────────────────────────────────────────────────────────── if command -v apk >/dev/null 2>&1 - alias install='sudo apk add' - alias update='sudo apk update' - alias search='sudo apk search' + alias install='$sudo apk add' + alias update='$sudo apk update' + alias search='$sudo apk search' set ALIASSES "-- Alpine.. right, this fast os is evolving.. --" end diff --git a/functions/c_fisher.fish b/functions/c_fisher.fish index 26a74ae..1d7f59a 100644 --- a/functions/c_fisher.fish +++ b/functions/c_fisher.fish @@ -11,8 +11,17 @@ if [[ ! -e $HOME/.config/fish/functions/fisher.fish ]] end end +set plugin "PatrickF1/fzf.fish" "jorgebucaran/autopair.fish" + function plugins_fisher - if command -v fisher >/dev/null 2>&1 - fisher install PatrickF1/fzf.fish + for plug in $plugin + if fisher update $plug + echo "Updated $plug" + else + fisher install $plug + echo "Installed $plug" + end end end + +plugins_fisher