mirror of
				https://github.com/ohmyzsh/ohmyzsh.git
				synced 2024-05-11 05:55:17 +00:00 
			
		
		
		
	Exclude .idea folder from grep search scope
This commit is contained in:
		
				
					committed by
					
						 Marc Cornellà
						Marc Cornellà
					
				
			
			
				
	
			
			
			
						parent
						
							498cd722b3
						
					
				
				
					commit
					b6f2cfdb93
				
			
							
								
								
									
										10
									
								
								lib/grep.zsh
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								lib/grep.zsh
									
									
									
									
									
								
							| @@ -10,13 +10,13 @@ if grep-flag-available --color=auto; then | |||||||
|     GREP_OPTIONS+=" --color=auto" |     GREP_OPTIONS+=" --color=auto" | ||||||
| fi | fi | ||||||
|  |  | ||||||
| # ignore VCS folders (if the necessary grep flags are available) | # ignore these folders (if the necessary grep flags are available) | ||||||
| VCS_FOLDERS="{.bzr,CVS,.git,.hg,.svn}" | EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea}" | ||||||
|  |  | ||||||
| if grep-flag-available --exclude-dir=.cvs; then | if grep-flag-available --exclude-dir=.cvs; then | ||||||
|     GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS" |     GREP_OPTIONS+=" --exclude-dir=$EXC_FOLDERS" | ||||||
| elif grep-flag-available --exclude=.cvs; then | elif grep-flag-available --exclude=.cvs; then | ||||||
|     GREP_OPTIONS+=" --exclude=$VCS_FOLDERS" |     GREP_OPTIONS+=" --exclude=$EXC_FOLDERS" | ||||||
| fi | fi | ||||||
|  |  | ||||||
| # export grep settings | # export grep settings | ||||||
| @@ -24,5 +24,5 @@ alias grep="grep $GREP_OPTIONS" | |||||||
|  |  | ||||||
| # clean up | # clean up | ||||||
| unset GREP_OPTIONS | unset GREP_OPTIONS | ||||||
| unset VCS_FOLDERS | unset EXC_FOLDERS | ||||||
| unfunction grep-flag-available | unfunction grep-flag-available | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user