mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-01-27 12:42:27 +00:00
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
13 lines
429 B
Nu
13 lines
429 B
Nu
# Search terms in the specified files and/or folders based on the glob pattern provided.
|
|
def "find in" [
|
|
glob: glob, # the glob expression
|
|
...rest: any # terms to search
|
|
]: nothing -> table<path: string, line: int, data: string> {
|
|
glob $glob
|
|
| par-each {|e|
|
|
open $e | lines | enumerate | rename line data |
|
|
find -c [data] ...$rest |
|
|
each {|match| {path: ($e | path relative-to $env.PWD), ...$match}}
|
|
} | flatten
|
|
}
|