Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
b6f2cfdb
Commit
b6f2cfdb
authored
May 12, 2016
by
Vital Kolas
Committed by
Marc Cornellà
Mar 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exclude .idea folder from grep search scope
parent
498cd722
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
grep.zsh
lib/grep.zsh
+5
-5
No files found.
lib/grep.zsh
View file @
b6f2cfdb
...
@@ -10,13 +10,13 @@ if grep-flag-available --color=auto; then
...
@@ -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"
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment