mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 14:12:41 +00:00
20 lines
336 B
Bash
Executable File
20 lines
336 B
Bash
Executable File
#!/bin/zsh
|
|
|
|
function vic() {
|
|
# opens a shell command in $EDITOR
|
|
cmd="$(command -v $1)"
|
|
|
|
[ -f "$cmd" ] \
|
|
&& "$EDITOR" "$cmd" \
|
|
&& return 0
|
|
|
|
# if command was not found try the function directory.
|
|
cmd="$ZFUNCDIR/$1"
|
|
[ -f "$cmd" ] \
|
|
&& "$EDITOR" "$cmd" \
|
|
&& return 0
|
|
|
|
echo "Command not found: $1"
|
|
return 1
|
|
}
|