Consistent default key bindings for ide_completion_menu (#13955)

Updates Ctrl+p to open the ide_completion menu and otherwise advance to
the "previous" menu item.

Ctrl+n opens the ide_completion_menu and subsequently advances to the
"next" menu item. Ctrl+p should share this behavior for the "previous"
menu item. See nushell/nushell#13946 for detailed discussion.

Tested by building and running nushell without a custom config, falling
back to this default config.
This commit is contained in:
Akira Baruah
2024-10-04 07:54:37 -04:00
committed by GitHub
parent 1e9967c3bf
commit 6ce20675eb
2 changed files with 66 additions and 20 deletions

View File

@ -403,10 +403,17 @@ $env.config = {
]
}
}
{
name: completion_previous_menu
modifier: shift
keycode: backtab
mode: [emacs, vi_normal, vi_insert]
event: { send: menuprevious }
}
{
name: ide_completion_menu
modifier: control
keycode: char_n
keycode: space
mode: [emacs vi_normal vi_insert]
event: {
until: [
@ -430,13 +437,6 @@ $env.config = {
mode: [emacs, vi_insert, vi_normal]
event: { send: menu name: help_menu }
}
{
name: completion_previous_menu
modifier: shift
keycode: backtab
mode: [emacs, vi_normal, vi_insert]
event: { send: menuprevious }
}
{
name: next_page_menu
modifier: control
@ -618,6 +618,18 @@ $env.config = {
mode: [emacs, vi_normal, vi_insert]
event: { edit: movetolineend }
}
{
name: move_down
modifier: control
keycode: char_n
mode: [emacs, vi_normal, vi_insert]
event: {
until: [
{ send: menudown }
{ send: down }
]
}
}
{
name: move_up
modifier: control
@ -630,18 +642,6 @@ $env.config = {
]
}
}
{
name: move_down
modifier: control
keycode: char_t
mode: [emacs, vi_normal, vi_insert]
event: {
until: [
{ send: menudown }
{ send: down }
]
}
}
{
name: delete_one_character_backward
modifier: none