diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2018-01-29 02:33:36 -0500 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2018-01-29 02:33:36 -0500 |
| commit | 6c9c17409b1c38364dcc5621b6473feb1cf9a5ca (patch) | |
| tree | 526aeae8d33ff6e946a4f338539966e97f42a530 | |
| parent | 5ea6e75a796633d32f2ddce373242c972c7b2e1d (diff) | |
| download | dotfiles-6c9c17409b1c38364dcc5621b6473feb1cf9a5ca.tar.gz dotfiles-6c9c17409b1c38364dcc5621b6473feb1cf9a5ca.tar.xz | |
A better way of setting the editor
| -rw-r--r-- | mkshrc | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -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 |
