mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-01-01 23:11:58 +00:00
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
22 lines
522 B
Nu
22 lines
522 B
Nu
def look_for [word] {
|
|
open sample_andres.json |
|
|
flatten |
|
|
flatten |
|
|
insert comp {
|
|
get shoes_name |
|
|
split row " " |
|
|
enumerate | each {
|
|
[[idx, loc]; [$in.index, ($in.item | str index-of $word)]]
|
|
} | flatten
|
|
} |
|
|
flatten |
|
|
where comp.loc >= 0 |
|
|
flatten |
|
|
update idx { $in + 1 } |
|
|
reject name price loc |
|
|
rename nameWords targetWordIndex
|
|
}
|
|
|
|
print (look_for "leather" | to json --indent 4)
|
|
print (look_for "low-top" | to json --indent 4)
|