From 96081bb9b00a10ee1b08aff26125283186ac9126 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Wed, 15 Feb 2023 13:47:57 +0200 Subject: [PATCH] rc/{bash,zsh]: alias vim to nvim Resolves: #151 --- .mikaela/environment | 2 +- rc/bashrc | 9 ++++++++- rc/zshrc | 9 ++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.mikaela/environment b/.mikaela/environment index 02afea46..9388a279 100644 --- a/.mikaela/environment +++ b/.mikaela/environment @@ -1 +1 @@ -export EDITOR=vim # MIKAELA_GREP MIKAELA_GREPENVIRONMENT +export EDITOR=nvim # MIKAELA_GREP MIKAELA_GREPENVIRONMENT diff --git a/rc/bashrc b/rc/bashrc index 7b45cc21..29124965 100644 --- a/rc/bashrc +++ b/rc/bashrc @@ -182,7 +182,7 @@ fi # Things after this are just examples and should be put to some other file, which is sourced above. # Sets the default editor. -#export EDITOR=vim # MIKAELA_GREP MIKAELA_GREP_ENVIRONMENT +#export EDITOR=nvim # MIKAELA_GREP MIKAELA_GREP_ENVIRONMENT # Set TZ to local timezone for sending over SSH TZ=$(date +%Z) @@ -536,6 +536,13 @@ fi # More simple SSH file signing, ~/.ssh/signingkey.pub should be a symlink alias ssh-sign-file="ssh-keygen -Y sign -f ~/.ssh/signingkey.pub -n file" +# I use nvim, while I keep running vim instead +if hash nvim 2>/dev/null; then + alias vim="echo 'using nvim instead' && nvim" +else + alias vim="echo 'nvim not found' && \vim" +fi + # Allow custom aliases to be put in .aliases or .bash_aliases . # .aliases diff --git a/rc/zshrc b/rc/zshrc index 5c80ddb4..64abe7fc 100644 --- a/rc/zshrc +++ b/rc/zshrc @@ -139,7 +139,7 @@ export TERM=screen-256color fi # Sets the default editor. -#export EDITOR=vim # MIKAELA_GREP MIKAELA_GREP_ENVIRONMENT +#export EDITOR=nvim # MIKAELA_GREP MIKAELA_GREP_ENVIRONMENT # Set TZ to local timezone for sending over SSH TZ=$(date +%Z) @@ -513,6 +513,13 @@ fi # More simple SSH file signing, ~/.ssh/signingkey.pub should be a symlink alias ssh-sign-file="ssh-keygen -Y sign -f ~/.ssh/signingkey.pub -n file" +# I use nvim, while I keep running vim instead +if hash nvim 2>/dev/null; then + alias vim="echo 'using nvim instead' && nvim" +else + alias vim="echo 'nvim not found' && \vim" +fi + # Allow custom aliases to be put in .aliases or .zsh_aliases . # .aliases