fix(zsh): better handle setting $EDITOR
Some checks failed
Check Formatting of Files / Check-Formatting (push) Failing after 1m3s

This commit is contained in:
Price Hiller 2024-05-27 14:33:54 -05:00
parent e5ec85048b
commit df340afa88
Signed by: Price
GPG Key ID: C3FADDE7A8534BEB
2 changed files with 7 additions and 9 deletions

View File

@ -123,9 +123,11 @@ fi
new_manpager=less
fi
export EDITOR="${EDITOR:-$new_editor}"
export VISUAL="${VISUAL:-$new_visual}"
export MANPAGER="${MANPAGER:-$new_manpager}"
if [[ -n "${new_editor}" ]]; then
export EDITOR="${new_editor}"
export VISUAL="${new_visual}"
export MANPAGER="${new_manpager}"
fi
}
### Rust ###

View File

@ -185,15 +185,11 @@ preexec() {
# Editor with single letter
e() {
if [[ "${EDITOR}" =~ "neovide*" ]]; then
neovide "${@}"
else
eval "${EDITOR} ${@}"
fi
eval "${EDITOR} ${@}"
}
# Open file with default program and detach
o() {
local in="${@}"
xdg-open "${@}" & disown
}
}