all repos — scriptura @ eea12c75e45b3ad7b76dfb89861fea82cad01c04

a corner in $HOME for your scripts

split helpers into files

Alan Pearce
commit

eea12c75e45b3ad7b76dfb89861fea82cad01c04

parent

fd61ac887fd4160094757c843ca55cbe1a49f552

1 file changed, 24 insertions(+), 0 deletions(-)

changed files
A functions/__scriptura_edit.fish
@@ -0,0 +1,24 @@
+function __scriptura_edit --argument-names script_path + if not set --query SCRIPTURA_EDITOR + set --function SCRIPTURA_EDITOR $( + if set --query SD_EDITOR + echo $SD_EDITOR + else if set --query VISUAL + echo $VISUAL + else if set --query EDITOR + echo $EDITOR + else if command --query vim + echo vim + else if command --query nano + echo nano + else if command --query vi + echo vi + else + echo "Don't know which editor to use, set \$SCRIPTURA_EDITOR, \$VISUAL or \$EDITOR!" >& 2 + return 1 + end + ) + end + + eval $SCRIPTURA_EDITOR $script_path +end