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

15 lines
439 B
Plaintext

MY_VI="$(type -fP my_vi || printf "%s -p" $(type -fP nvim) || type -fP vi) "
[[ ! -z "${MY_VI}" ]] \
&& alias my_editor="${MY_VI} " \
&& alias nvim="${MY_VI} " \
&& alias vim="${MY_VI} " \
&& alias vi="${MY_VI} "
[[ -n $(which-command "${EDITOR}") ]] \
&& alias my_editor="${EDITOR} "
[[ -n $(which-command my_editor) ]] \
&& alias ed="my_editor" \
&& alias edit="my_editor" \
&& alias editor="my_editor"