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-07 16:34:50 +00:00
|
|
|
alias my_editor='edit-with-spacemacs'
|
2022-06-04 18:56:36 +00:00
|
|
|
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
|
2022-06-07 16:34:50 +00:00
|
|
|
alias my_editor='eval $EDITOR '
|
2022-06-04 18:56:36 +00:00
|
|
|
else
|
2022-06-07 16:34:50 +00:00
|
|
|
alias my_editor="$PREFERED_VI"
|
2022-06-04 18:56:36 +00:00
|
|
|
fi
|
|
|
|
else
|
2022-06-07 16:34:50 +00:00
|
|
|
alias my_editor="$PREFERED_VI -p"
|
2022-06-04 18:56:36 +00:00
|
|
|
fi
|
|
|
|
fi
|
2022-06-07 16:34:50 +00:00
|
|
|
alias nvim="my_editor"
|
|
|
|
alias vim="my_editor"
|
|
|
|
alias vi="my_editor"
|
2022-06-04 18:56:36 +00:00
|
|
|
|
2022-06-07 16:34:50 +00:00
|
|
|
alias ed="my_editor"
|
|
|
|
alias edit="my_editor"
|
|
|
|
alias editor="my_editor"
|