added fzf.zsh
This commit is contained in:
		
							parent
							
								
									1a780bad64
								
							
						
					
					
						commit
						980fa0ddb2
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		
							
								
								
									
										17
									
								
								fzf.sh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								fzf.sh
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| export FZF_COMPLETION_OPTS='--border --info=inline' | ||||
| 
 | ||||
| # (EXPERIMENTAL) Advanced customization of fzf options via _fzf_comprun function | ||||
| # - The first argument to the function is the name of the command. | ||||
| # - You should make sure to pass the rest of the arguments to fzf. | ||||
| _fzf_comprun() { | ||||
|   local command=$1 | ||||
|   shift | ||||
| 
 | ||||
|   case "$command" in | ||||
|     vim)          fzf "$@" --preview 'batcat --color=always {}' ;; | ||||
|     cd)           fzf "$@" --preview 'tree -C {} | head -200' ;; | ||||
|     export|unset) fzf "$@" --preview "eval 'echo \$'{}" ;; | ||||
|     ssh)          fzf "$@" --preview 'dig {}' ;; | ||||
|     *)            fzf "$@" ;; | ||||
|   esac | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue