diff --git a/.profile b/.profile index e6eaeb2..6c147a9 100644 --- a/.profile +++ b/.profile @@ -5,9 +5,24 @@ if [ -z "$SSH_CLIENT" ] && [ -z "$SSH_TTY" ]; then eval `keychain --eval id_ed25519` fi -# These are pretty safe to assume exist +# Put ~/bin first in my path so I can customize commands +# This isn't great on a security level and I should stop this. export PATH=~/bin:$PATH -export EDITOR=vim + +# Figure out my editor. I want helix if this box has it, but where it is +# is inconsistent thanks to Archlinux packaging. It can be /usr/bin/helix, +# or /usr/bin/hx. My puppet code creates /bin/hx to normalize this too. +# If we don't have helix, just shotgun using vim and pray. +if [ -e /bin/hx ]; then + export EDITOR=/bin/hx +elif [ -e /usr/bin/helix ]; then + export EDITOR=/usr/bin/helix +elif [ -e /usr/bin/hx ]; then + export EDITOR=/usr/bin/hx +else + export EDITOR=vim +fi + export VISUAL=$EDITOR # Figure out my pager; these don't necessarily exist