diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2012-05-07 17:25:25 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2012-05-07 17:25:25 +0200 |
commit | 77ed7ae949602598aac8558f21447ef5eee80ab8 (patch) | |
tree | cf1b5fb12e0a3cdfc648040f0bf2c8717c56351b /bashrc | |
parent | 48b9936d4d32d97611022cbe98772d95def2a0a8 (diff) | |
download | dotfiles-77ed7ae949602598aac8558f21447ef5eee80ab8.tar.gz dotfiles-77ed7ae949602598aac8558f21447ef5eee80ab8.tar.xz dotfiles-77ed7ae949602598aac8558f21447ef5eee80ab8.zip |
bashrc/common/env: added detection for a valid editor
Diffstat (limited to 'bashrc')
-rw-r--r-- | bashrc/common/env.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bashrc/common/env.sh b/bashrc/common/env.sh index e02e6ad..2ddb235 100644 --- a/bashrc/common/env.sh +++ b/bashrc/common/env.sh @@ -1,5 +1,12 @@ # force sane editor -export EDITOR=/usr/bin/nano +editor="nano vim emacsclient" + +for b in $editor ; do + if hash $b > /dev/null 2>&1 ; then + export EDITOR="$(which $b)" + break + fi +done # set timezone if needed [[ -z "$TZ" ]] && export TZ=Europe/Berlin |