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

32 lines
752 B
Plaintext
Raw Normal View History

PREFERED_VI=$(which-command nvim vim | head -1)
2022-06-09 18:22:39 +00:00
if [[ -z "$PREFERED_VI" ]]; then
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
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
EDITOR=$(which-command edit-with-spacemacs | head -1)
alias my_editor="$EDITOR "
else
EDITOR="$PREFERRED_VI"
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"