nushell: keybinds support for helix mode (#4914)
CodeQL / Analyze (go) (push) Canceled after 0s
build / build (push) Canceled after 0s
Test fzf on macOS / build (push) Canceled after 0s

Thanks!
This commit is contained in:
Simon Désaulniers
2026-09-09 09:20:02 +09:00
committed by GitHub
parent a1e983baf1
commit 63e82a9e3d
+20 -6
View File
@@ -47,6 +47,20 @@ def __fzfcmd []: nothing -> list<string> {
['fzf'] ['fzf']
} }
# Keybinding modes to activate. The Helix modes only exist since Nushell
# 0.115.0, so they are only included when running a version that supports
# them (major > 0 covers a hypothetical 1.0+ where the minor resets).
def __fzf_modes []: nothing -> list<string> {
let v = version
let major = ($v.major | into int)
let minor = ($v.minor | into int)
if ($major > 0) or ($minor >= 115) {
['emacs', 'vi_normal', 'vi_insert', 'helix_normal', 'helix_select', 'helix_insert']
} else {
['emacs', 'vi_normal', 'vi_insert']
}
}
export-env { export-env {
$env.FZF_CTRL_T_OPTS = $env.FZF_CTRL_T_OPTS? | default "" $env.FZF_CTRL_T_OPTS = $env.FZF_CTRL_T_OPTS? | default ""
@@ -55,11 +69,11 @@ export-env {
} }
# Directories # Directories
const alt_c = { let alt_c = {
name: fzf_dirs name: fzf_dirs
modifier: alt modifier: alt
keycode: char_c keycode: char_c
mode: [emacs, vi_normal, vi_insert] mode: (__fzf_modes)
event: [ event: [
{ {
send: executehostcommand send: executehostcommand
@@ -82,11 +96,11 @@ const alt_c = {
} }
# History # History
const ctrl_r = { let ctrl_r = {
name: fzf_history name: fzf_history
modifier: control modifier: control
keycode: char_r keycode: char_r
mode: [emacs, vi_insert, vi_normal] mode: (__fzf_modes)
event: [ event: [
{ {
send: executehostcommand send: executehostcommand
@@ -115,11 +129,11 @@ const ctrl_r = {
} }
# Files # Files
const ctrl_t = { let ctrl_t = {
name: fzf_files name: fzf_files
modifier: control modifier: control
keycode: char_t keycode: char_t
mode: [emacs, vi_normal, vi_insert] mode: (__fzf_modes)
event: [ event: [
{ {
send: executehostcommand send: executehostcommand