From 10f9c6b91ccc6e7d3ef88ed7dfd3d00e2e87ae9e Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Thu, 19 Jan 2023 15:44:36 -0800 Subject: [PATCH] Use nvim as EDITOR if it is installed --- base/.config/profile/env.d/base.env | 1 - base/.config/profile/profile.d/base.sh | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/base/.config/profile/env.d/base.env b/base/.config/profile/env.d/base.env index 7b6c505..48cc8a0 100644 --- a/base/.config/profile/env.d/base.env +++ b/base/.config/profile/env.d/base.env @@ -1,6 +1,5 @@ #shellcheck disable=SC2034 BROWSER=firefox -EDITOR=vim HISTCONTROL=ignoredups:erasedups:ignorespace HISTFILESIZE= HISTSIZE= diff --git a/base/.config/profile/profile.d/base.sh b/base/.config/profile/profile.d/base.sh index 842e4ba..963494c 100644 --- a/base/.config/profile/profile.d/base.sh +++ b/base/.config/profile/profile.d/base.sh @@ -2,6 +2,12 @@ alias slugify="sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z" +if type nvim >/dev/null 2>/dev/null ; then + export EDITOR=nvim +else + export EDITOR=vim +fi + source_env_file () { if [ ! -f "${1}" ]; then return