diff --git a/assets/default/dotfiles/bashrc b/assets/default/dotfiles/bashrc index 639cd75..2131d34 100644 --- a/assets/default/dotfiles/bashrc +++ b/assets/default/dotfiles/bashrc @@ -92,8 +92,12 @@ fi # Increase memory sizes for java using Ant export ANT_OPTS="-Xmx2048m -Xms512m" -# Set vim to default editor -export EDITOR=vim +# Set vim or nvim to default editor +if type nvim &> /dev/null ; then + export EDITOR=nvim +else + export EDITOR=vim +fi export VISUAL="$EDITOR" # Set file as having been loaded to avoid looping diff --git a/assets/default/dotfiles/zshrc b/assets/default/dotfiles/zshrc index e0f5188..1eabdb3 100644 --- a/assets/default/dotfiles/zshrc +++ b/assets/default/dotfiles/zshrc @@ -158,8 +158,12 @@ if [ -n "$FZF_DEFAULT_COMMAND" ]; then export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND \$dir" fi -# Set vim to default editor -export EDITOR=vim +# Set vim or nvim to default editor +if type nvim &> /dev/null ; then + export EDITOR=nvim +else + export EDITOR=vim +fi export VISUAL="$EDITOR" # vim: set filetype=zsh: diff --git a/assets/default/fish/init/env.fish b/assets/default/fish/init/env.fish index fb142a3..f7ee065 100644 --- a/assets/default/fish/init/env.fish +++ b/assets/default/fish/init/env.fish @@ -6,8 +6,12 @@ set -gx XDG_CACHE_HOME "$HOME/.cache" # Increase memory sizes for java using Ant set -gx ANT_OPTS "-Xmx2048m -Xms512m" -# Set default editor to vim -set -gx EDITOR vim +# Set default editor to vim or nvim +if type -q nvim + set -gx EDITOR nvim +else + set -gx EDITOR vim +end set -gx VISUAL "$EDITOR" # Interractive env variables