diff options
| author | ryukamish <[email protected]> | 2026-07-23 01:17:27 +0530 |
|---|---|---|
| committer | ryukamish <[email protected]> | 2026-07-23 01:17:27 +0530 |
| commit | 8538b69b5f858c3b3e532035c17a09396b31003e (patch) | |
| tree | ec65256d1d35187dee4a7a96f5fdebd9f8c23b26 /vic | |
| parent | df63ca181f3be23f9e5530cd7fa81169ee7b0664 (diff) | |
add: open command file from any directory
Diffstat (limited to 'vic')
| -rwxr-xr-x | vic | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 |
