From 6c9c17409b1c38364dcc5621b6473feb1cf9a5ca Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Mon, 29 Jan 2018 02:33:36 -0500 Subject: A better way of setting the editor --- mkshrc | 10 +++------- 1 file 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 -- cgit v1.2.3