2022-06-18 18:13:08 +00:00
|
|
|
PREFERED_VI=$(which-command nvim vim | head -1)
|
2022-06-09 18:22:39 +00:00
|
|
|
if [[ -z "$PREFERED_VI" ]]; then
|
2022-06-18 18:13:08 +00:00
|
|
|
PREFERED_VI=$(which-command vi | head -1)
|
2022-06-09 18:22:39 +00:00
|
|
|
|
|
|
|
if [[ -z "$PREFERED_VI" ]]; then
|
|
|
|
alias my_vi='eval $EDITOR '
|
|
|
|
else
|
|
|
|
alias my_vi="$PREFERED_VI"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
alias my_vi="$PREFERED_VI -p"
|
|
|
|
fi
|
|
|
|
|
2022-07-25 15:20:19 +00:00
|
|
|
export DOOMROOT="$HOME/.config/_my.emacs/doom"
|
|
|
|
[[ -x $DOOMROOT/emacs.d/bin/doom ]] && function doom() {
|
|
|
|
export EMACSDIR="$DOOMROOT/emacs.d"
|
|
|
|
export DOOMDIR="$DOOMROOT/config"
|
|
|
|
"$EMACSDIR/bin/doom" "${@}"
|
|
|
|
|
|
|
|
unset EMACSDIR DOOMDIR
|
|
|
|
} && function doomemacs() {
|
|
|
|
emacs --with-profile=doom ${@}
|
|
|
|
} || unset DOOMROOT
|
|
|
|
|
2022-06-07 04:41:52 +00:00
|
|
|
if [[ -r "$HOME/.config/_my.emacs/spacemacs/emacs.d/init.el" \
|
2022-06-18 18:13:08 +00:00
|
|
|
&& -n "$(which-command emacsclient)" \
|
|
|
|
&& -n "$(which-command emacs)" \
|
|
|
|
&& -n "$(which-command edit-with-spacemacs)" \
|
2022-06-07 04:41:52 +00:00
|
|
|
]]; then
|
2022-07-25 15:20:19 +00:00
|
|
|
alias my_editor='edit-with-spacemacs'
|
2022-06-04 18:56:36 +00:00
|
|
|
else
|
2022-06-09 18:22:39 +00:00
|
|
|
alias my_editor='my_vi'
|
2022-06-04 18:56:36 +00:00
|
|
|
fi
|
2022-06-09 18:22:39 +00:00
|
|
|
alias nvim="my_vi"
|
|
|
|
alias vim="my_vi"
|
|
|
|
alias vi="my_vi"
|
2022-06-04 18:56:36 +00:00
|
|
|
|
2022-06-07 16:34:50 +00:00
|
|
|
alias ed="my_editor"
|
|
|
|
alias edit="my_editor"
|
2022-06-09 18:22:39 +00:00
|
|
|
alias editor="my_editor"
|