From 0f667e4d76857f582048a6560320c5515749242d Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 4 Nov 2025 00:26:24 +0000 Subject: qedit: quickly write up some code in your editor of choice Generates a temp file (with your choice of extension) which you can then write code in immediately. --- Scripts/.local/scripts/qedit | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 Scripts/.local/scripts/qedit diff --git a/Scripts/.local/scripts/qedit b/Scripts/.local/scripts/qedit new file mode 100755 index 0000000..44cfa18 --- /dev/null +++ b/Scripts/.local/scripts/qedit @@ -0,0 +1,25 @@ +#!/usr/bin/env sh + +if [ $# -eq 0 ] || [ $# -gt 2 ] +then + printf "Usage: $0 [editor]\n" + exit 1 +fi + +name=$(mktemp --suffix=".$1") +editor="" + +if [ $# -eq 1 ] +then + if [ -z "$EDITOR" ] + then + editor="vim"; + else + editor="$EDITOR"; + fi +elif [ $# -eq 2 ] +then + editor="$2" +fi + +$editor $name -- cgit v1.2.3-13-gbd6f