From 15747c317728fd6797dc915adb69ee8508e4f767 Mon Sep 17 00:00:00 2001 From: lelgenio Date: Fri, 18 Jun 2021 01:13:46 -0300 Subject: [PATCH] fish: add sv shortcut --- dotfiles/fish/alias.fish | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dotfiles/fish/alias.fish b/dotfiles/fish/alias.fish index 12b9435..16d8975 100644 --- a/dotfiles/fish/alias.fish +++ b/dotfiles/fish/alias.fish @@ -170,12 +170,24 @@ function man -w man _man $argv end + +################################################################ +# sv +################################################################ + +function sv -w sv + set -l o (command sv $argv 2> /dev/null ) + and printf "%s\n" $o + or sudo sv $argv +end + + ################################################################ # quickly edit dotfiles ################################################################ function edit-config - pushd "{{@@ parent_dir ( _dotdrop_dotpath ) @@}}" + pushd (dirname "$DOTDROP_CONFIG") set -l dotfile (fd -HE .git | wdmenu) test -n "$dotfile" || return 1 {{@@ editor @@}} "$dotfile"