1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00
nu_scripts/custom-menus/extra/vars.nu
Antoine Stevan 832f34fa06
move the extra menus of Nushell into custom-menus/extra/ (#550)
* add the extra menus in `custom-menus/extra/`

* add some notes about how to use the extra menus in bindings
2023-07-21 10:44:27 +02:00

29 lines
705 B
Text

# can be used in the REPL by adding something like the following block to `$env.config.keybindings` in your `config.nu`
# {
# name: vars_menu
# modifier: alt
# keycode: char_o
# mode: [emacs, vi_normal, vi_insert]
# event: { send: menu name: vars_menu }
# }
{
name: vars_menu
only_buffer_difference: true
marker: "# "
type: {
layout: list
page_size: 10
}
style: {
text: green
selected_text: green_reverse
description_text: yellow
}
source: { |buffer, position|
scope variables
| where name =~ $buffer
| sort-by name
| each { |it| {value: $it.name description: $it.type} }
}
}