diff options
-rw-r--r-- | .profile | 14 | ||||
-rw-r--r-- | .selected_editor | 2 | ||||
l--------- | bin/editor | 1 | ||||
-rwxr-xr-x | bin/v-editor | 7 |
4 files changed, 21 insertions, 3 deletions
@@ -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 diff --git a/.selected_editor b/.selected_editor new file mode 100644 index 0000000..095d9cf --- /dev/null +++ b/.selected_editor @@ -0,0 +1,2 @@ +# Generated by /usr/bin/select-editor +SELECTED_EDITOR="emacsclient -a ''" diff --git a/bin/editor b/bin/editor new file mode 120000 index 0000000..8ca5677 --- /dev/null +++ b/bin/editor @@ -0,0 +1 @@ +v-editor
\ No newline at end of file diff --git a/bin/v-editor b/bin/v-editor new file mode 100755 index 0000000..dc141bc --- /dev/null +++ b/bin/v-editor @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ -n "$DISPLAY" ]; then + ${VISUAL:-$SELECTED_EDITOR} $@ +else + ${EDITOR:-$SELECTED_EDITOR} $@ +fi |