[zsh] Move vi init to init_env_vi; set EDITOR in that function
This commit is contained in:
		
							parent
							
								
									4317bfd61e
								
							
						
					
					
						commit
						09ea02303d
					
				
					 4 changed files with 6 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -3,7 +3,6 @@
 | 
			
		|||
 | 
			
		||||
export PAGER="less"
 | 
			
		||||
export MANPAGER=$PAGER
 | 
			
		||||
export EDITOR="vim"
 | 
			
		||||
export VISUAL=$EDITOR
 | 
			
		||||
export LESSHISTFILE="-"
 | 
			
		||||
export GREP_OPTIONS="--color=auto"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
							
								
								
									
										5
									
								
								zshenv
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								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 \
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								zshrc
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								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 \
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue