]> granicus.if.org Git - graphviz/commitdiff
vimdot: lookup 'vim' in $PATH
authorBjørn Forsman <bjorn.forsman@gmail.com>
Tue, 6 Jan 2015 19:39:41 +0000 (20:39 +0100)
committerBjørn Forsman <bjorn.forsman@gmail.com>
Tue, 6 Jan 2015 19:54:07 +0000 (20:54 +0100)
Instead of hardcoding /usr/bin/vim. Needed for NixOS (http://nixos.org), and is
probably useful for others too.

plugin/xlib/vimdot.sh

index 749fe6a384e54aac56b4e71d3cc904b197570dc8..4e6dd4bb406d82184352739ad0e6f3114cddab7f 100755 (executable)
@@ -3,9 +3,9 @@
 
 error() { echo "$0: $*" >&2; exit 1; }
 
-editor="/usr/bin/vim"
+editor="vim"
 
-if ! test -x "$editor"; then error "the \"$editor\" editor not found or not executable"; fi
+if ! test -x "$(command -v "$editor")"; then error "the \"$editor\" editor not found or not executable"; fi
 
 default="noname.gv"