nushell alt-l to accept autocomplete
This commit is contained in:
42
nushell/modules/pj_historyhintcomplete.nu
Normal file
42
nushell/modules/pj_historyhintcomplete.nu
Normal 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
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -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 *
|
||||
|
||||
Reference in New Issue
Block a user