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'