From b1566353e5423975793df2fd07ca8e7d48c83534 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Sun, 9 May 2021 10:55:05 +0300 Subject: [PATCH] [zsh+nvim] fix sudoedit detection --- zsh/aliases.zsh | 1 - zsh/functions.zsh | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index c82c197..8d960ae 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -87,7 +87,6 @@ alias e="$EDITOR" if [[ "$EDITOR" == *vim ]]; then alias es="e -S" fi -alias sue="sudo --edit" alias rsync-backup='rsync --archive --compress --verbose --human-readable --partial --progress' diff --git a/zsh/functions.zsh b/zsh/functions.zsh index f7775a7..a9d956d 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -95,3 +95,10 @@ unset date_formats if (( _is_linux )) && command_exists swapoff && command_exists swapon; then deswap() { sudo sh -c 'swapoff --all && swapon --all'; } fi + +# Taken from +sudoedit() { + SUDO_COMMAND="sudoedit $@" command sudoedit "$@" +} +alias sudoe="sudoedit" +alias sue="sudoedit"