mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00

This PR is part of porting all old scripts #221 and includes a set of modules: - fuzzy -> `modules/fuzzy/fuzzy_command_search.nu` - ls-mods -> `modules/ls-mods`: `ls-less.nu`, `ls-wide.nu` and `ls-wide-with-color.nu` - nu_101 -> `modules/nu_101`: `nothing.nu` and `inner_outer_loop.nu` Edit: `fuzzy` and `nu_101` have been moved to `sourced`
12 lines
302 B
Text
12 lines
302 B
Text
# An attempt at trying to put ls into a paging mode
|
|
export def ls-less [
|
|
--dir(-d):any # The directory you want to list
|
|
] {
|
|
let is_empty = ($dir | is-empty)
|
|
if $is_empty {
|
|
nu -c 'ls' | less -r
|
|
} else {
|
|
let command = $"ls ($dir)"
|
|
nu -c $command | less -r
|
|
}
|
|
}
|