From 6b697a4888a43a2518a4733e926c4d06771171b3 Mon Sep 17 00:00:00 2001 From: Kevin Cotugno Date: Tue, 31 Oct 2017 16:53:38 -0700 Subject: [PATCH] Add editor checks --- profile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/profile b/profile index d227308..0914161 100644 --- a/profile +++ b/profile @@ -52,7 +52,20 @@ if [[ -f "$HOME/.ssh-sentinel.sh" ]]; then source "$HOME/.ssh-sentinel.sh" fi -export EDITOR="nvim" +which nvim &> /dev/null +neovim="$?" + +which vim &> /dev/null +vim="$?" + +if (( !$neovim )); then + export EDITOR="nvim" +elif (( !$vim )); then + export EDITOR="vim" +else + export EDITOR="vi" +fi + alias l="ls -lah" alias ll="ls -lh"