From 36282a44639052d0f3aa19a07ac5145090824345 Mon Sep 17 00:00:00 2001 From: lub Date: Sat, 16 May 2020 14:14:44 +0200 Subject: [PATCH] make editor choice more flexibel --- dotfiles/bash/.bashrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dotfiles/bash/.bashrc b/dotfiles/bash/.bashrc index 2e36f7c..143f90a 100644 --- a/dotfiles/bash/.bashrc +++ b/dotfiles/bash/.bashrc @@ -9,7 +9,14 @@ export HISTSIZE=10000 export HISTFILESIZE=10000 export PATH="$HOME/.bin:$PATH" -export EDITOR=vim +# define a default editor +if [ -x "$(command -v caode)" ]; then + export EDITOR=code +elif [ -x "$(command -v vim)" ]; then + export EDITOR=vim +elif [ -x "$(command -v vi)" ]; then + export EDITOR=vi +fi #enable wayland export QT_QPA_PLATFORM=wayland-egl