As you can see the `until` keyword allows us to define two events for the same
keybinding. At the moment of this writing, only the Menu events allow this type
of layering. The other non menu event types will always return a success value,
meaning that the `until` event will stop as soon as it reaches the command.
For example, the next keybinding will always send a `down` because that event
is always successful
```nu
$env.config = {
...
keybindings: [
{
name: completion_menu
modifier: control
keycode: char_t
mode: emacs
event: {
until: [
{ send: down }
{ send: menu name: completion_menu }
{ send: menunext }
]
}
}
]
...
}
```
### Removing a Default Keybinding
If you want to remove a certain default keybinding without replacing it with a different action, you can set `event: null`.
e.g. to disable screen clearing with `Ctrl + l` for all edit modes
```nu
$env.config = {
...
keybindings: [
{
modifier: control
keycode: char_l
mode: [emacs, vi_normal, vi_insert]
event: null
}
]
...
}
```
### Troubleshooting Keybinding Problems
Your terminal environment may not always propagate your key combinations on to Nushell the way you expect it to. You can use the command [`keybindings listen`](/commands/docs/keybindings_listen.md) to determine if certain keypresses are actually received by Nushell, and how.
## Menus
Thanks to Reedline, Nushell has menus that can help you with your day to day
shell scripting. Next we present the default menus that are always available
when using Nushell
### Menu Keybindings
When a menu is active, some keybindings change based on the keybinding [`until` specifier](#until-type) discussed above. Common keybindings for menus are:
| Key | Event |
| ------------------------------- | -------------------- |
| <kbd>Tab</kbd> | Select next item |
| <kbd>Shift</kbd>+<kbd>Tab</kbd> | Select previous item |
| <kbd>Enter</kbd> | Accept selection |
| <kbd>↑</kbd> (Up Arrow) | Move menu up |
| <kbd>↓</kbd> (Down Arrow) | Move menu down |
| <kbd>←</kbd> (Left Arrow) | Move menu left |
| <kbd>→</kbd> (Right Arrow) | Move menu right |
| <kbd>Ctrl</kbd>+<kbd>P</kbd> | Move menu up |
| <kbd>Ctrl</kbd>+<kbd>N</kbd> | Move menu down |
| <kbd>Ctrl</kbd>+<kbd>B</kbd> | Move menu left |
| <kbd>Ctrl</kbd>+<kbd>F</kbd> | Move menu right |
::: note
Menu direction behavior varies based on the menu type (see below). For example,
in a `description` menu, "Up" and "Down" apply to the "Extra" list, but in a
`list` menu the directions apply to the selection.
:::
### Help Menu
The help menu is there to ease your transition into Nushell. Say you are
putting together an amazing pipeline and then you forgot the internal command
that would reverse a string for you. Instead of deleting your pipe, you can
activate the help menu with `F1`. Once active just type keywords for the
command you are looking for and the menu will show you commands that match your
input. The matching is done on the name of the commands or the commands
description.
To navigate the menu you can select the next element by using `tab`, you can
scroll the description by pressing left or right and you can even paste into
the line the available command examples.
The help menu can be configured by modifying the next parameters
```nu
$env.config = {
...
menus = [
...
{
name: help_menu
only_buffer_difference: true # Search is done on the text written after activating the menu
marker: "? " # Indicator that appears with the menu is active
type: {
layout: description # Type of menu
columns: 4 # Number of columns where the options are displayed