From c4ac91f163328ee83b51a245b6ec1ea7dce0fb7a Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Sat, 28 Oct 2023 23:16:18 +0100 Subject: [PATCH] Set EDITOR in .bashrc --- roles/bash/templates/bashrc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/bash/templates/bashrc b/roles/bash/templates/bashrc index 1b73ca5..a8ff7e4 100644 --- a/roles/bash/templates/bashrc +++ b/roles/bash/templates/bashrc @@ -113,3 +113,10 @@ PS1="$yellow\u$reset@$grey\h$reset " # Setup environment variables export PATH=$HOME/.local/bin:$PATH +if command -v nvim > /dev/null; then + export EDITOR=nvim +elif command -v vim > /dev/null; then + export EDITOR=vim +elif command -v vi > /dev/null; then + export EDITOR=vi +fi