Embryonic vim configuration.
[profile] / bash_profile
index bdf839c..3da56a8 100644 (file)
@@ -80,6 +80,10 @@ if [ -d /usr/local/plan9 ]; then
     $PLAN9/bin
 fi
 
+# --- Find whether a program exists ---
+
+__mdw_programp () { type -t >/dev/null "$1"; }
+
 # --- And the same for manual pages ---
 
 case "$MACHTIME" in
@@ -98,6 +102,19 @@ export NAME="Mark Wooding"
 export EMAIL=`__mdw_conf email`
 export QMAILINJECT=c
 
+# --- Find a text editor ---
+
+export MDW_EDITOR=ed
+for ed in "emacs21 -nw" "emacs -nw" vi pico nano ae; do
+  name=`echo $ed | sed 's/ .*$//'`
+  if __mdw_programp "$name"; then
+    MDW_EDITOR=$ed
+    break
+  fi
+done
+
+export EDITOR=mdw-editor VISUAL=mdw-editor
+
 # --- Various options for programs ---
 
 umask 002
@@ -106,15 +123,7 @@ umask 002
 
 unset LANG LC_COLLATE
 
-export EDITOR=ed
-for ed in "emacs21 -nw" "emacs -nw" vi pico nano ae; do
-  name=`echo $ed | sed 's/ .*$//'`
-  if type -t >/dev/null "$name"; then
-    EDITOR=$ed
-    break
-  fi
-done
-export VISUAL="$EDITOR"
+__mdw_programp distcc && export CCACHE_PREFIX=distcc
 
 export TEXINPUTS=".:$HOME/lib/tex//:"