diff --git a/nushell/modules/pj_historyhintcomplete.nu b/nushell/modules/pj_historyhintcomplete.nu new file mode 100644 index 0000000..a44e859 --- /dev/null +++ b/nushell/modules/pj_historyhintcomplete.nu @@ -0,0 +1,42 @@ +const alt_l_history_completion = { + name: alt_l_history_completion + modifier: alt + keycode: char_l + mode: [emacs, vi_insert, vi_normal] + event: { + until: [ + { send: historyhintcomplete } + { send: menuright } + { send: right } + ] + } +} + +const alt_uppercasel_history_completion = { + name: alt_uppercasel_history_completion + modifier: alt_shift + keycode: char_l + mode: [emacs, vi_insert, vi_normal] + event: { + until: [ + { send: historyhintwordcomplete } + { edit: movewordright, select: false} + ] + } +} + +export-env { + let has_alt_l_history_completion = $env.config.keybindings | where name == "alt_l_history_completion" | is-not-empty + if not $has_alt_l_history_completion { + $env.config.keybindings = $env.config.keybindings | append [ + $alt_l_history_completion + ] + } + + let has_alt_uppercasel_history_completion = $env.config.keybindings | where name == "alt_uppercasel_history_completion" | is-not-empty + if not $has_alt_uppercasel_history_completion { + $env.config.keybindings = $env.config.keybindings | append [ + $alt_uppercasel_history_completion + ] + } +} diff --git a/nushell/nu_polyjuice.nu b/nushell/nu_polyjuice.nu index 5bf0b57..277d50b 100644 --- a/nushell/nu_polyjuice.nu +++ b/nushell/nu_polyjuice.nu @@ -9,3 +9,4 @@ use modules/pj_aliases.nu * use modules/pj_fzf.nu * use modules/pj_zoxide.nu * use modules/pj_prompt.nu * +use modules/pj_historyhintcomplete.nu *