-
Notifications
You must be signed in to change notification settings - Fork 1
/
.functionshrc
42 lines (34 loc) · 1.32 KB
/
.functionshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# This file contains functions shared between bash and zsh
# thse are find functions. So they start with f. They use the -F option to prefent the search term from being treated as a regular expression. The "standard"
# version of these functions are also case insensitive. They all search recursively. They are basically used to find a search term across all files in a
# project without missing anything. The lack of case sensitivity helps not to miss anything, as does the lack of regular expression support since regular
# expressions are complicated and so often do not do what you think they do. Case sensitive versions of these search functions are provided for special case
# usage, but it is recommended not to use them except when they are specifically required
# find in php files
fp() {
grep -Frin --include="*.php" "$@" .
}
# case sensitive version of fp
exact_fp() {
grep -Fr --include="*.php" "$@" .
}
# find in web files
fw() {
grep -Fri --include="*."{php,cs,html,js,css} "$@" .
}
# case sensitive version of fw
exact_fw() {
grep -Fr --include="*."{php,cs,html,js,css} "$@" .
}
# find in C# files (fc is already taken. the n in fn is for .NET)
fn() {
grep -Fri --include="*.cs" "$@" .
}
# case sensitive version of fn
exact_fn() {
grep -Fr --include="*.cs" "$@" .
}
# find in all files
f_all() {
grep -Fri "$@" .
}