aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2018-01-29 02:33:36 -0500
committerMitch Riedstra <mitch@riedstra.us>2018-01-29 02:33:36 -0500
commit6c9c17409b1c38364dcc5621b6473feb1cf9a5ca (patch)
tree526aeae8d33ff6e946a4f338539966e97f42a530
parent5ea6e75a796633d32f2ddce373242c972c7b2e1d (diff)
downloaddotfiles-6c9c17409b1c38364dcc5621b6473feb1cf9a5ca.tar.gz
dotfiles-6c9c17409b1c38364dcc5621b6473feb1cf9a5ca.tar.xz
A better way of setting the editor
-rw-r--r--mkshrc10
1 files changed, 3 insertions, 7 deletions
diff --git a/mkshrc b/mkshrc
index f2f5fd7..9be5faf 100644
--- a/mkshrc
+++ b/mkshrc
@@ -543,13 +543,10 @@ colormanpages() {
#|_| |_|_|___/\___| |_| \__,_|_| |_|\___|\__|_|\___/|_| |_|___/
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
set_editor() {
- export EDITOR="vi"
+ # export EDITOR="vi"
- if [ -x "$(which nvim)" ] ; then
- export EDITOR="$(which nvim)"
- elif [ -x "$(which vim)" ] ; then
- export EDITOR="$(which vim)"
- fi
+ export EDITOR="$(which ed mg nano vi vim nvim 2>/dev/null | tail -n1)"
+ export VISUAL="$EDITOR"
# Set an alias for our editor of choice
alias vi="$EDITOR"
@@ -607,7 +604,6 @@ COLOR=1
set_pager
set_editor
export PATH="$HOME/bin:$PATH"
-export VISUAL="$EDITOR"
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin