Skip to content
Myr

nushell: keybinds support for helix mode (#4914)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Thanks!

authored by Simon Désaulniers · committed by GitHub · parent a1e983b · Browse files · 1 file+20 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+20 added−6 removed

  • other:+20 added−6 removed

1 file+20 added−6 removed

modified:shell/key-bindings.nu+20 added-6 removed
45 unmodified lines
46 }47 ['fzf']48}4950# Keybinding modes to activate. The Helix modes only exist since Nushell51# 0.115.0, so they are only included when running a version that supports52# them (major > 0 covers a hypothetical 1.0+ where the minor resets).53def __fzf_modes []: nothing -> list<string> {54 let v = version55 let major = ($v.major | into int)56 let minor = ($v.minor | into int)57 if ($major > 0) or ($minor >= 115) {58 ['emacs', 'vi_normal', 'vi_insert', 'helix_normal', 'helix_select', 'helix_insert']59 } else {60 ['emacs', 'vi_normal', 'vi_insert']61 }62}636465export-env {66 $env.FZF_CTRL_T_OPTS = $env.FZF_CTRL_T_OPTS? | default ""67 $env.FZF_CTRL_R_OPTS = $env.FZF_CTRL_R_OPTS? | default ""68 $env.FZF_ALT_C_OPTS = $env.FZF_ALT_C_OPTS? | default ""69}7071# Directories58const alt_c = {72let alt_c = {73 name: fzf_dirs74 modifier: alt75 keycode: char_c62 mode: [emacs, vi_normal, vi_insert]76 mode: (__fzf_modes)77 event: [78 {79 send: executehostcommand80 cmd: "
14 unmodified lines
95 ]96}9798# History85const ctrl_r = {99let ctrl_r = {100 name: fzf_history101 modifier: control102 keycode: char_r89 mode: [emacs, vi_insert, vi_normal]103 mode: (__fzf_modes)104 event: [105 {106 send: executehostcommand107 cmd: "commandline edit --replace (
20 unmodified lines
128 ]129}130131# Files118const ctrl_t = {132let ctrl_t = {133 name: fzf_files134 modifier: control135 keycode: char_t122 mode: [emacs, vi_normal, vi_insert]136 mode: (__fzf_modes)137 event: [138 {139 send: executehostcommand140 cmd: "
40 unmodified lines