From: Michael D. Lowis Date: Thu, 15 Jun 2017 17:22:40 +0000 (-0400) Subject: Added edit function to the editrc shell script example X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=99d822785dd8431e3f3dcbfcbdbe2820a08540bb;p=projs%2Ftide.git Added edit function to the editrc shell script example --- diff --git a/editrc b/editrc index 3c5fbff..2ed0558 100644 --- a/editrc +++ b/editrc @@ -1,5 +1,21 @@ #!/bin/bash +edit(){ + # setup editor env + export PATH="$HOME/.config/edit/tools:$PATH" + export EDITRCFILE="$HOME/.config/edit/editrc" + export BASH_ENV="$EDITRCFILE" + [[ -f "$EDITRCFILE" ]] && . "$EDITRCFILE" + + # Now figure out the correct editor to execute + if [[ -z "$DISPLAY" ]]; then + "$EDITOR" "$@" + else + # Launch in the background and disown + { tide "$@" & disown; } &> /dev/null + fi +} + # Tag Lines #------------------------------------------------------------------------------