From 09ea02303d0e3d282d75c4839f6c82e4b9e138f8 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 28 May 2022 09:07:40 -0700 Subject: [PATCH] [zsh] Move vi init to init_env_vi; set EDITOR in that function --- zsh/func/init_env | 1 - zsh/func/{init_rc_vi => init_env_vi} | 4 ++++ zshenv | 5 ++--- zshrc | 1 - 4 files changed, 6 insertions(+), 5 deletions(-) rename zsh/func/{init_rc_vi => init_env_vi} (78%) diff --git a/zsh/func/init_env b/zsh/func/init_env index 564f49b..49d8d3a 100644 --- a/zsh/func/init_env +++ b/zsh/func/init_env @@ -3,7 +3,6 @@ export PAGER="less" export MANPAGER=$PAGER -export EDITOR="vim" export VISUAL=$EDITOR export LESSHISTFILE="-" export GREP_OPTIONS="--color=auto" diff --git a/zsh/func/init_rc_vi b/zsh/func/init_env_vi similarity index 78% rename from zsh/func/init_rc_vi rename to zsh/func/init_env_vi index f0af5e8..63eef8a 100644 --- a/zsh/func/init_rc_vi +++ b/zsh/func/init_env_vi @@ -5,6 +5,10 @@ if whence -cp nvim &> -; then alias vi=nvim + export EDITOR=nvim elif whence -cp vim &> -; then alias vi=vim + export EDITOR=vim fi + +export editor=vi diff --git a/zshenv b/zshenv index 4d3a24e..a06b3dd 100644 --- a/zshenv +++ b/zshenv @@ -9,14 +9,13 @@ export SYS=`uname -s | tr A-Z a-z` fpath=("$HOME/.zsh/func" $fpath) -autoload -Uz prepend_to_path -autoload -Uz append_to_path autoload -Uz do_init_functions typeset -a zsh_init_env_functions=( \ + init_path \ init_env \ init_env_python \ - init_path \ + init_env_vi \ init_env_$SYS \ ) diff --git a/zshrc b/zshrc index b3f3fdf..3db633f 100644 --- a/zshrc +++ b/zshrc @@ -3,7 +3,6 @@ zsh_init_rc_functions=( \ init_rc_aliases \ - init_rc_vi \ init_configure_ls \ init_rc_tilde_paths \ init_rc_configure_prompt \