[zsh] Move vi function to a simple alias in init_rc_vi
This commit is contained in:
		
							parent
							
								
									a66be0e49e
								
							
						
					
					
						commit
						e8aae4ef89
					
				
					 2 changed files with 8 additions and 15 deletions
				
			
		
							
								
								
									
										8
									
								
								zsh/func/init_rc_vi
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								zsh/func/init_rc_vi
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
#!/usr/bin/env zsh
 | 
			
		||||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 | 
			
		||||
if whence -cp nvim &>-; then
 | 
			
		||||
    alias vi=nvim
 | 
			
		||||
elif whence -cp vim &>-; then
 | 
			
		||||
    alias vi=vim
 | 
			
		||||
fi
 | 
			
		||||
							
								
								
									
										15
									
								
								zsh/func/vi
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								zsh/func/vi
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,15 +0,0 @@
 | 
			
		|||
#!/usr/bin/env zsh
 | 
			
		||||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 | 
			
		||||
function vi
 | 
			
		||||
{
 | 
			
		||||
    if whence -cp nvim 1>/dev/null 2>&1; then
 | 
			
		||||
        command nvim $@
 | 
			
		||||
    elif whence -cp vim 1>/dev/null 2>&1; then
 | 
			
		||||
        command vim $@
 | 
			
		||||
    elif whence -cp vi 1>/dev/null 2>&1; then
 | 
			
		||||
        command vi $@
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
vi "$@"
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue