mirror of
https://github.com/nushell/nushell
synced 2025-01-14 06:04:09 +00:00
Change history menu keybinding from ctrl+x to ctrl+r (#5507)
* Change history menu keybinding to ctrl+r from ctrl+x * Remove menupage actions from default config * remove trailing whitespace * re-add next+previous page keybindings * Remove hardcoded menu keybindings * Hardcode new keybindings
This commit is contained in:
parent
1aec4a343a
commit
f818193b53
2 changed files with 19 additions and 15 deletions
|
@ -501,14 +501,16 @@ fn add_menu_keybindings(keybindings: &mut Keybindings) {
|
||||||
ReedlineEvent::MenuPrevious,
|
ReedlineEvent::MenuPrevious,
|
||||||
);
|
);
|
||||||
|
|
||||||
// History menu keybinding
|
keybindings.add_binding(
|
||||||
|
KeyModifiers::CONTROL,
|
||||||
|
KeyCode::Char('r'),
|
||||||
|
ReedlineEvent::Menu("history_menu".to_string()),
|
||||||
|
);
|
||||||
|
|
||||||
keybindings.add_binding(
|
keybindings.add_binding(
|
||||||
KeyModifiers::CONTROL,
|
KeyModifiers::CONTROL,
|
||||||
KeyCode::Char('x'),
|
KeyCode::Char('x'),
|
||||||
ReedlineEvent::UntilFound(vec![
|
ReedlineEvent::MenuPageNext,
|
||||||
ReedlineEvent::Menu("history_menu".to_string()),
|
|
||||||
ReedlineEvent::MenuPageNext,
|
|
||||||
]),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
keybindings.add_binding(
|
keybindings.add_binding(
|
||||||
|
|
|
@ -201,7 +201,7 @@ let-env config = {
|
||||||
cd_with_abbreviations: false # set to true to allow you to do things like cd s/o/f and nushell expand it to cd some/other/folder
|
cd_with_abbreviations: false # set to true to allow you to do things like cd s/o/f and nushell expand it to cd some/other/folder
|
||||||
hooks: {
|
hooks: {
|
||||||
pre_prompt: [{
|
pre_prompt: [{
|
||||||
$nothing # replace with source code to run before the prompt is shown
|
$nothing # replace with source code to run before the prompt is shown
|
||||||
}]
|
}]
|
||||||
pre_execution: [{
|
pre_execution: [{
|
||||||
$nothing # replace with source code to run before the repl input is run
|
$nothing # replace with source code to run before the repl input is run
|
||||||
|
@ -349,17 +349,19 @@ let-env config = {
|
||||||
{
|
{
|
||||||
name: history_menu
|
name: history_menu
|
||||||
modifier: control
|
modifier: control
|
||||||
keycode: char_x
|
keycode: char_r
|
||||||
mode: emacs
|
mode: emacs
|
||||||
event: {
|
event: { send: menu name: history_menu }
|
||||||
until: [
|
|
||||||
{ send: menu name: history_menu }
|
|
||||||
{ send: menupagenext }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name: history_previous
|
name: next_page
|
||||||
|
modifier: control
|
||||||
|
keycode: char_x
|
||||||
|
mode: emacs
|
||||||
|
event: { send: menupagenext }
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name: undo_or_previous_page
|
||||||
modifier: control
|
modifier: control
|
||||||
keycode: char_z
|
keycode: char_z
|
||||||
mode: emacs
|
mode: emacs
|
||||||
|
@ -368,7 +370,7 @@ let-env config = {
|
||||||
{ send: menupageprevious }
|
{ send: menupageprevious }
|
||||||
{ edit: undo }
|
{ edit: undo }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# Keybindings used to trigger the user defined menus
|
# Keybindings used to trigger the user defined menus
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue