2022-06-07 04:41:52 +00:00
|
|
|
if [[ -r "$HOME/.config/_my.emacs/spacemacs/emacs.d/init.el" \
|
|
|
|
&& -n "$(type -fP emacsclient)" \
|
|
|
|
&& -n "$(type -fP emacs)" \
|
|
|
|
&& -n "$(type -fP edit-with-spacemacs)" \
|
|
|
|
]]; then
|
2022-06-04 18:56:36 +00:00
|
|
|
alias vi_editor='edit-with-spacemacs'
|
|
|
|
else
|
|
|
|
PREFERED_VI=$(type -fP nvim vim | head -1)
|
|
|
|
if [[ -z "$PREFERED_VI" ]]; then
|
|
|
|
PREFERED_VI=$(type -fP vi | head -1)
|
|
|
|
|
|
|
|
if [[ -z "$PREFERED_VI" ]]; then
|
|
|
|
alias vi_editor='eval $EDITOR '
|
|
|
|
else
|
|
|
|
alias vi_editor="$PREFERED_VI"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
alias vi_editor="$PREFERED_VI -p"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
alias nvim="vi_editor"
|
|
|
|
alias vim="vi_editor"
|
|
|
|
alias vi="vi_editor"
|
|
|
|
|
|
|
|
alias ed="vi_editor"
|