From 5e4a91f28354aa337cd9a1b348515cd2abf9b671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Sun, 19 Feb 2023 12:28:41 +0100 Subject: [PATCH] Added the EDITOR and VISUAL vim or nvim --- .zshrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.zshrc b/.zshrc index 18d3f18..57514d1 100644 --- a/.zshrc +++ b/.zshrc @@ -143,6 +143,14 @@ if [[ "$(uname)" == "Darwin" ]]; then alias meraki="cd $HOME/git/ansible_collections/cisco/meraki/" fi +# Setting the right editor +if which nvim > /dev/null 2>&1; then + export VISUAL='nvim -u $HOME/.vimrc' + export EDITOR='nvim -u $HOME/.vimrc' +else + export VISUAL='vim -u $HOME/.vimrc-def' + export EDITOR='vim -u $HOME/.vimrc-def' +fi # Aliases alias vimc="$EDITOR $HOME/.vimrc"