Move fff function from find to fdfind
This commit is contained in:
		
							parent
							
								
									35c5bb5b79
								
							
						
					
					
						commit
						8f9e91b3ff
					
				
							
								
								
									
										8
									
								
								zshrc
								
								
								
								
							
							
						
						
									
										8
									
								
								zshrc
								
								
								
								
							|  | @ -1252,7 +1252,7 @@ alias stat_sys="echo ' ' && uname -a && echo ' '&& uptime &&echo ' '&& df && ech | |||
| 
 | ||||
| ##Cree le repertoire et va dedans | ||||
| function mkcd() { | ||||
|   mkdir $1 && cd $_ | ||||
|   mkdir -- $1 && cd $_ | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|  | @ -2122,7 +2122,7 @@ ffu() { | |||
| } | ||||
| # }}} | ||||
| # fff - cd to the directory of the selected file {{{ | ||||
| # Search with find (fd|fdfind overkill the CPU for few benefits on small tree) | ||||
| # Search with fd (after few tests, fdfind is fareway better than find… even on small tree) | ||||
| # Check for symlinked files too | ||||
| # Allow to give arguments to prefill fzf request | ||||
| # Display a directory preview tree of the selected file with exa | ||||
|  | @ -2134,10 +2134,10 @@ fff() { | |||
| 	## Manage argument {{{ | ||||
| 	if [ "${#}" -eq "0" ]; then | ||||
| 		## Default command without args | ||||
| 		file=$(find . -xtype f | fzf --prompt='cd> ' --height=50% --preview 'exa --tree --level 2 $(dirname {}) | head --lines=20' --no-multi) && | ||||
| 		file=$(fd -uu --type file --type symlink | fzf --prompt='cd> ' --height=50% --preview 'exa --tree --level 2 $(dirname {}) | head --lines=20' --no-multi) && | ||||
| 	else | ||||
| 		## If at least one argument was given, add it to fzf query | ||||
| 		file=$(find . -xtype f | fzf --prompt='cd> ' --height=50% --preview 'exa --tree --level 2 $(dirname {}) | head --lines=20' --no-multi --query "${*} ") && | ||||
| 		file=$(fd -uu --type file --type symlink | fzf --prompt='cd> ' --height=50% --preview 'exa --tree --level 2 $(dirname {}) | head --lines=20' --no-multi --query "${*} ") && | ||||
| 	fi | ||||
| 	## }}} | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue