From df340afa88c6fd1f3434560a80bba3193f72a365 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Mon, 27 May 2024 14:33:54 -0500 Subject: [PATCH] fix(zsh): better handle setting $EDITOR --- .../price/dots/.config/zsh/config/profile/profile/env.zsh | 8 +++++--- .../dots/.config/zsh/config/profile/profile/functions.zsh | 8 ++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/users/price/dots/.config/zsh/config/profile/profile/env.zsh b/users/price/dots/.config/zsh/config/profile/profile/env.zsh index db160adb..26ae71c0 100644 --- a/users/price/dots/.config/zsh/config/profile/profile/env.zsh +++ b/users/price/dots/.config/zsh/config/profile/profile/env.zsh @@ -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 ### diff --git a/users/price/dots/.config/zsh/config/profile/profile/functions.zsh b/users/price/dots/.config/zsh/config/profile/profile/functions.zsh index eeed9a72..3b00728b 100644 --- a/users/price/dots/.config/zsh/config/profile/profile/functions.zsh +++ b/users/price/dots/.config/zsh/config/profile/profile/functions.zsh @@ -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 -} \ No newline at end of file +}