nushell alt-l to accept autocomplete

This commit is contained in:
2026-02-02 19:36:49 +08:00
parent 3d22ed9633
commit 0bb8f0e5e8
2 changed files with 43 additions and 0 deletions

View File

@@ -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
]
}
}

View File

@@ -9,3 +9,4 @@ use modules/pj_aliases.nu *
use modules/pj_fzf.nu * use modules/pj_fzf.nu *
use modules/pj_zoxide.nu * use modules/pj_zoxide.nu *
use modules/pj_prompt.nu * use modules/pj_prompt.nu *
use modules/pj_historyhintcomplete.nu *