mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-01-22 10:29:03 +00:00
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
25 lines
544 B
Nu
25 lines
544 B
Nu
use ../conversions/into.nu *
|
|
|
|
# Return a list of indices
|
|
# for the provided ranges or indices.
|
|
# Primarily used as a helper for
|
|
# "select ranges" et. al.
|
|
#
|
|
# Example:
|
|
#
|
|
# row-indices 0 2..5 7..8
|
|
# # => ╭───┬───╮
|
|
# # => │ 0 │ 0 │
|
|
# # => │ 1 │ 2 │
|
|
# # => │ 2 │ 3 │
|
|
# # => │ 3 │ 4 │
|
|
# # => │ 4 │ 5 │
|
|
# # => │ 5 │ 7 │
|
|
# # => │ 6 │ 8 │
|
|
# # => ╰───┴───╯
|
|
export def main [ ...ranges ] {
|
|
$ranges
|
|
| reduce -f [] {|range,indices|
|
|
$indices ++ ($range | into list)
|
|
}
|
|
} |