summaryrefslogtreecommitdiff
path: root/.profile
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-04-15 17:03:59 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-04-15 17:03:59 -0400
commitf62b10487c2d2560923865b07306765f8ff055a2 (patch)
treed8843020a98833e688a53d2d23436741f5e719fe /.profile
parentd63d53e4b21cc68b04e3c52c717f507f785f6258 (diff)
Fiddle with the default editor
Start tracking .selected editor, make use of this in .profile. Create the v-editor script, which calls either $VISUAL, $EDITOR, or $SELECTED editor, depending. Symlink `v-editor' to `editor', to overide /bin/editor, which might be used by some stupid programs.
Diffstat (limited to '.profile')
-rw-r--r--.profile14
1 files changed, 11 insertions, 3 deletions
diff --git a/.profile b/.profile
index c9db459..8808917 100644
--- a/.profile
+++ b/.profile
@@ -8,6 +8,11 @@
# for ssh logins, install and configure the libpam-umask package.
#umask 022
+# set PATH so it includes user's private bin if it exists
+if [ -d "$HOME/bin" ]; then
+ export PATH="$HOME/bin:$PATH"
+fi
+
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
@@ -16,7 +21,10 @@ if [ -n "$BASH_VERSION" ]; then
fi
fi
-# set PATH so it includes user's private bin if it exists
-if [ -d "$HOME/bin" ] ; then
- PATH="$HOME/bin:$PATH"
+# set SELECTED_EDITOR, EDITOR, and VISUAL to set the text editor used
+if [ -f "$HOME/.selected_editor" ]; then
+ . "$HOME/.selected_editor"
+ export SELECTED_EDITOR
+ export EDITOR="${EDITOR:-$SELECTED_EDITOR}"
+ export VISUAL="${VISUAL:-$SELECTED_EDITOR}"
fi