dotfiles.2022/_home/dot_sz.shrc.d/22_editor.aliases

31 lines
791 B
Plaintext

MY_VI="$(type -fP my_vi)"
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
if [[ -r "$HOME/.config/_my.emacs/spacemacs/emacs.d/init.el" \
&& -n "$(which-command emacsclient)" \
&& -n "$(which-command emacs)" \
&& -n "$(which-command edit-with-spacemacs)" \
]]; then
alias my_editor='edit-with-spacemacs'
else
alias my_editor="${MY_VI} "
fi
alias nvim="${MY_VI} "
alias vim="${MY_VI} "
alias vi="${MY_VI} "
alias ed="my_editor"
alias edit="my_editor"
alias editor="my_editor"