mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 22:22:40 +00:00
Cleaning up some scripts and moving to autoload functions
This commit is contained in:
19
zsh/config/functions/vic
Executable file
19
zsh/config/functions/vic
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/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
|
||||
}
|
||||
Reference in New Issue
Block a user