mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-01-06 00:51:57 +00:00
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
27 lines
561 B
Nu
27 lines
561 B
Nu
use ./row-indices.nu *
|
|
|
|
# Selects one or more rows while keeping
|
|
# the original indices.
|
|
#
|
|
# Example - Selects the first, fifth, and
|
|
# sixth rows from the table:
|
|
#
|
|
# ls / | select ranges 0 4..5
|
|
#
|
|
# Example - Select the 5th row:
|
|
#
|
|
# ls / | select 5
|
|
#
|
|
# Example - Select the 4th row.
|
|
# Note that the difference beteen this
|
|
# and `select 3` is that the index (#)
|
|
# column shows the *original* (pre-select)
|
|
# position in the table.
|
|
#
|
|
# ls | select ranges 3
|
|
export def "select ranges" [ ...ranges ] {
|
|
enumerate
|
|
| flatten
|
|
| select ...(row-indices ...$ranges)
|
|
}
|