mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 22:57:46 +00:00
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
This commit is contained in:
parent
4f0e47d954
commit
832f34fa06
3 changed files with 91 additions and 0 deletions
30
custom-menus/extra/commands.nu
Normal file
30
custom-menus/extra/commands.nu
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# can be used in the REPL by adding something like the following block to `$env.config.keybindings` in your `config.nu`
|
||||||
|
# {
|
||||||
|
# name: commands_menu
|
||||||
|
# modifier: control
|
||||||
|
# keycode: char_t
|
||||||
|
# mode: [emacs, vi_normal, vi_insert]
|
||||||
|
# event: { send: menu name: commands_menu }
|
||||||
|
# }
|
||||||
|
|
||||||
|
{
|
||||||
|
name: commands_menu
|
||||||
|
only_buffer_difference: false
|
||||||
|
marker: "# "
|
||||||
|
type: {
|
||||||
|
layout: columnar
|
||||||
|
columns: 4
|
||||||
|
col_width: 20
|
||||||
|
col_padding: 2
|
||||||
|
}
|
||||||
|
style: {
|
||||||
|
text: green
|
||||||
|
selected_text: green_reverse
|
||||||
|
description_text: yellow
|
||||||
|
}
|
||||||
|
source: { |buffer, position|
|
||||||
|
scope commands
|
||||||
|
| where name =~ $buffer
|
||||||
|
| each { |it| {value: $it.name description: $it.usage} }
|
||||||
|
}
|
||||||
|
}
|
32
custom-menus/extra/commands_with_description.nu
Normal file
32
custom-menus/extra/commands_with_description.nu
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
# can be used in the REPL by adding something like the following block to `$env.config.keybindings` in your `config.nu`
|
||||||
|
# {
|
||||||
|
# name: commands_with_description_menu
|
||||||
|
# modifier: control
|
||||||
|
# keycode: char_s
|
||||||
|
# mode: [emacs, vi_normal, vi_insert]
|
||||||
|
# event: { send: menu name: commands_with_description }
|
||||||
|
# }
|
||||||
|
|
||||||
|
{
|
||||||
|
name: commands_with_description_menu
|
||||||
|
only_buffer_difference: true
|
||||||
|
marker: "# "
|
||||||
|
type: {
|
||||||
|
layout: description
|
||||||
|
columns: 4
|
||||||
|
col_width: 20
|
||||||
|
col_padding: 2
|
||||||
|
selection_rows: 4
|
||||||
|
description_rows: 10
|
||||||
|
}
|
||||||
|
style: {
|
||||||
|
text: green
|
||||||
|
selected_text: green_reverse
|
||||||
|
description_text: yellow
|
||||||
|
}
|
||||||
|
source: { |buffer, position|
|
||||||
|
scope commands
|
||||||
|
| where name =~ $buffer
|
||||||
|
| each { |it| {value: $it.name description: $it.usage} }
|
||||||
|
}
|
||||||
|
}
|
29
custom-menus/extra/vars.nu
Normal file
29
custom-menus/extra/vars.nu
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
# 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} }
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue