From 162577efcc4171b9b46845bb8290f2356602bb23 Mon Sep 17 00:00:00 2001 From: RealStickman Date: Thu, 12 Nov 2020 16:38:11 +0100 Subject: [PATCH] Add sue !! function to fish --- arch-config/.config/fish/config.fish | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch-config/.config/fish/config.fish b/arch-config/.config/fish/config.fish index c281e023..4caf7b41 100644 --- a/arch-config/.config/fish/config.fish +++ b/arch-config/.config/fish/config.fish @@ -31,6 +31,15 @@ set VISUAL "/usr/bin/emacs --no-window-system" # add paths set fish_user_paths "$HOME/.emacs.d/bin/" $fish_user_paths +# use sudo !! to run the last command as root +function sudo --description "Replacement for Bash 'sudo !!' command to run last command using sudo." + if test "$argv" = !! + eval command sudo $history[1] +else + command sudo $argv + end +end + #update config alias upconf='~/scripts/arcolinux-config.sh'