summary refs log tree commit diff
path: root/pkgs/tools/graphics/graphviz/0001-vimdot-lookup-vim-in-PATH.patch
blob: d5f71a4de9e52273e8de2a4fc45c1b14ca73b919 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 2008bf62e13ebe41cdad3e16f8b42f46ae393876 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
Date: Tue, 6 Jan 2015 20:39:41 +0100
Subject: [PATCH] vimdot: lookup 'vim' in $PATH

Instead of hardcoding /usr/bin/vim. Needed for NixOS (http://nixos.org), and is
probably useful for others too.
---
 plugin/xlib/vimdot.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugin/xlib/vimdot.sh b/plugin/xlib/vimdot.sh
index 749fe6a..4e6dd4b 100755
--- a/plugin/xlib/vimdot.sh
+++ b/plugin/xlib/vimdot.sh
@@ -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"
 
-- 
2.1.3