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 new_manpager=less
fi fi
export EDITOR="${EDITOR:-$new_editor}" if [[ -n "${new_editor}" ]]; then
export VISUAL="${VISUAL:-$new_visual}" export EDITOR="${new_editor}"
export MANPAGER="${MANPAGER:-$new_manpager}" export VISUAL="${new_visual}"
export MANPAGER="${new_manpager}"
fi
} }
### Rust ### ### Rust ###

View File

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