diff options
-rw-r--r-- | dot_config/zsh/dot_zshenv | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/dot_config/zsh/dot_zshenv b/dot_config/zsh/dot_zshenv index 19d3b96..efee663 100644 --- a/dot_config/zsh/dot_zshenv +++ b/dot_config/zsh/dot_zshenv @@ -8,14 +8,21 @@ export FPATH="$FPATH:${XDG_DATA_HOME:-$HOME/.local/share/zsh/site-functions}" unsetopt PROMPT_SP +if command -v nvim >/dev/null 2>&1 +then + DEFAULT_EDITOR="nvim +star" +else + DEFAULT_EDITOR="nano" +fi + # Default programs for SSH or not if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then + export BROWSER="w3m" + export EDITOR="$DEFAULT_EDITOR" +else export BROWSER="chromium" # shellcheck disable=SC2015 - [ -n "$DISPLAY" ] && export EDITOR="code -nw" || export EDITOR="nvim +star" -else - export BROWSER="w3m" - export EDITOR="nvim +star" + [ -n "$DISPLAY" ] && export EDITOR="code -nw" || export EDITOR="$DEFAULT_EDITOR" fi export VISUAL="$EDITOR" |