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

30 lines
656 B
Plaintext
Raw Normal View History

2022-06-09 18:22:39 +00:00
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 my_vi='eval $EDITOR '
else
alias my_vi="$PREFERED_VI"
fi
else
alias my_vi="$PREFERED_VI -p"
fi
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
alias my_editor='edit-with-spacemacs'
else
2022-06-09 18:22:39 +00:00
alias my_editor='my_vi'
fi
2022-06-09 18:22:39 +00:00
alias nvim="my_vi"
alias vim="my_vi"
alias vi="my_vi"
alias ed="my_editor"
alias edit="my_editor"
2022-06-09 18:22:39 +00:00
alias editor="my_editor"