summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorryukamish <[email protected]>2026-07-23 01:17:27 +0530
committerryukamish <[email protected]>2026-07-23 01:17:27 +0530
commit8538b69b5f858c3b3e532035c17a09396b31003e (patch)
treeec65256d1d35187dee4a7a96f5fdebd9f8c23b26
parentdf63ca181f3be23f9e5530cd7fa81169ee7b0664 (diff)
add: open command file from any directory
-rwxr-xr-xvic12
1 files changed, 12 insertions, 0 deletions
diff --git a/vic b/vic
new file mode 100755
index 0000000..d6ca7b1
--- /dev/null
+++ b/vic
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+RED="\e[31m" RESET="\e[0m"
+
+cmd=$(which "$1" 2>/dev/null)
+editor="${EDITOR:-nvim}"
+
+if [ -z "$cmd" ]; then
+ printf '\n%b\n' "${RED}Error${RESET}: command not in path or wrong name."
+else
+ "$editor" "$cmd" || exit 0
+fi