From 1d3ea54fde17c2cb0e17089f64129a38cc145605 Mon Sep 17 00:00:00 2001 From: MunHammer Date: Tue, 21 Apr 2026 18:05:45 +1200 Subject: [PATCH 1/5] Formatted everything - Mainly with fish-lsp - A bit of manual work for multi-line strings --- functions/fish_bind_count.fish | 4 +- functions/fish_helix_command.fish | 308 ++++++++++++------------- functions/fish_helix_key_bindings.fish | 31 +-- 3 files changed, 165 insertions(+), 178 deletions(-) diff --git a/functions/fish_bind_count.fish b/functions/fish_bind_count.fish index c865701..3f2545e 100644 --- a/functions/fish_bind_count.fish +++ b/functions/fish_bind_count.fish @@ -1,5 +1,5 @@ function fish_bind_count - argparse 'h/help' 'z/zero' 'r/read' -- $argv + argparse h/help z/zero r/read -- $argv or return 1 if test -n "$_flag_help" echo "Helper function to track count modifier with modal key bindings" @@ -25,4 +25,4 @@ function fish_bind_count echo "$count" end end -end \ No newline at end of file +end diff --git a/functions/fish_helix_command.fish b/functions/fish_helix_command.fish index a70268a..0bfd31c 100644 --- a/functions/fish_helix_command.fish +++ b/functions/fish_helix_command.fish @@ -2,7 +2,7 @@ # because of unsynchronized `commandline -f` and `commandline -C` function fish_helix_command - argparse 'h/help' -- $argv + argparse h/help -- $argv or return 1 if test -n "$_flag_help" echo "Helper function to handle modal key bindings mostly outside of insert mode" @@ -16,153 +16,151 @@ function fish_helix_command set -f count_defined $status switch $command - case {move,extend}_char_left - commandline -C (math max\(0, (commandline -C) - $count\)) - __fish_helix_extend_by_command $command - case {move,extend}_char_right - commandline -C (math (commandline -C) + $count) - __fish_helix_extend_by_command $command - - case char_up - __fish_helix_char_up $fish_bind_mode $count - case char_down - __fish_helix_char_down $fish_bind_mode $count - - case next_word_start - # https://regex101.com/r/KXrl1x/1 - set -l regex (string join '' \ - '(?:.?\\n+|' \ - '[[:alnum:]_](?=[^[:alnum:]_\\s])|' \ - '[^[:alnum:]_\\s](?=[[:alnum:]_])|' \ - '[^\\S\\n](?=[\\S\\n])|)' \ - '((?:[[:alnum:]_]+|[^[:alnum:]_\\s]+|)[^\\S\\n]*)' \ - ) - __fish_helix_next_word $fish_bind_mode $count $regex - - case next_long_word_start - set -l regex (string join '' \ - '(?:.?\\n+|' \ - '[^\\S\\n](?=[\\S\\n])|)' \ - '(\\S*[^\\S\\n]*)' \ - ) - __fish_helix_next_word $fish_bind_mode $count $regex - - case next_word_end - # https://regex101.com/r/Gl0KP2/1 - set -l regex ' (?: + case {move,extend}_char_left + commandline -C (math max\(0, (commandline -C) - $count\)) + __fish_helix_extend_by_command $command + case {move,extend}_char_right + commandline -C (math (commandline -C) + $count) + __fish_helix_extend_by_command $command + + case char_up + __fish_helix_char_up $fish_bind_mode $count + case char_down + __fish_helix_char_down $fish_bind_mode $count + + case next_word_start + # https://regex101.com/r/KXrl1x/1 + set -l regex (string join '' \ + '(?:.?\\n+|' \ + '[[:alnum:]_](?=[^[:alnum:]_\\s])|' \ + '[^[:alnum:]_\\s](?=[[:alnum:]_])|' \ + '[^\\S\\n](?=[\\S\\n])|)' \ + '((?:[[:alnum:]_]+|[^[:alnum:]_\\s]+|)[^\\S\\n]*)' \ + ) + __fish_helix_next_word $fish_bind_mode $count $regex + + case next_long_word_start + set -l regex (string join '' \ + '(?:.?\\n+|' \ + '[^\\S\\n](?=[\\S\\n])|)' \ + '(\\S*[^\\S\\n]*)' \ + ) + __fish_helix_next_word $fish_bind_mode $count $regex + + case next_word_end + # https://regex101.com/r/Gl0KP2/1 + set -l regex ' (?: .?\\n+ | [[:alnum:]_](?=[^[:alnum:]_]) | [^[:alnum:]_\\s](?=[[:alnum:]_\\s]) | ) - ( [^\\S\\n]* + ( [^\\S\\n]* (?: [[:alnum:]_]+ | [^[:alnum:]_\\s]+ | ) ) ' - __fish_helix_next_word $fish_bind_mode $count $regex + __fish_helix_next_word $fish_bind_mode $count $regex - case next_long_word_end - set -l regex ' (?: .?\\n+ | \\S(?=\\s) | ) + case next_long_word_end + set -l regex ' (?: .?\\n+ | \\S(?=\\s) | ) ( [^\\S\\n]* \\S* ) ' - __fish_helix_next_word $fish_bind_mode $count $regex + __fish_helix_next_word $fish_bind_mode $count $regex - case prev_word_start - set -l regex ' ( (?: + case prev_word_start + set -l regex ' ( (?: [[:alnum:]_]+ | [^[:alnum:]_\\s]+ | ) - [^\\S\\n]* ) - (?: \\n+.? | + [^\\S\\n]* ) + (?: \\n+.? | (?<=[^[:alnum:]_])[[:alnum:]_] | (?<=[[:alnum:]_\\s])[^[:alnum:]_\\s] | ) ' - __fish_helix_prev_word $fish_bind_mode $count $regex - - case prev_long_word_start - set -l regex ' - ( \\S* [^\\S\\n]* ) - (?: \\n+.? | (?<=\\s)\\S | ) ' - __fish_helix_prev_word $fish_bind_mode $count $regex - - - case till_next_char - __fish_helix_find_char $fish_bind_mode $count forward-jump-till forward-char - case find_next_char - __fish_helix_find_char $fish_bind_mode $count forward-jump - case till_prev_char - __fish_helix_find_char $fish_bind_mode $count backward-jump-till backward-char - case find_prev_char - __fish_helix_find_char $fish_bind_mode $count backward-jump - - case till_next_cr - __fish_helix_find_next_cr $fish_bind_mode $count 2 - case find_next_cr - __fish_helix_find_next_cr $fish_bind_mode $count 1 - case till_prev_cr - __fish_helix_find_prev_cr $fish_bind_mode $count 1 - case find_prev_cr - __fish_helix_find_prev_cr $fish_bind_mode $count 0 - - case goto_line_start - commandline -f beginning-of-line - __fish_helix_extend_by_mode - case goto_line_end - __fish_helix_goto_line_end - __fish_helix_extend_by_mode - case goto_first_nonwhitespace - __fish_helix_goto_first_nonwhitespace - __fish_helix_extend_by_mode - - case goto_file_start - __fish_helix_goto_line $count - case goto_line - if test "$count_defined" = 0 # if true + __fish_helix_prev_word $fish_bind_mode $count $regex + + case prev_long_word_start + set -l regex ' + ( \\S* [^\\S\\n]* ) + (?: \\n+.? | (?<=\\s)\\S | ) ' + __fish_helix_prev_word $fish_bind_mode $count $regex + + case till_next_char + __fish_helix_find_char $fish_bind_mode $count forward-jump-till forward-char + case find_next_char + __fish_helix_find_char $fish_bind_mode $count forward-jump + case till_prev_char + __fish_helix_find_char $fish_bind_mode $count backward-jump-till backward-char + case find_prev_char + __fish_helix_find_char $fish_bind_mode $count backward-jump + + case till_next_cr + __fish_helix_find_next_cr $fish_bind_mode $count 2 + case find_next_cr + __fish_helix_find_next_cr $fish_bind_mode $count 1 + case till_prev_cr + __fish_helix_find_prev_cr $fish_bind_mode $count 1 + case find_prev_cr + __fish_helix_find_prev_cr $fish_bind_mode $count 0 + + case goto_line_start + commandline -f beginning-of-line + __fish_helix_extend_by_mode + case goto_line_end + __fish_helix_goto_line_end + __fish_helix_extend_by_mode + case goto_first_nonwhitespace + __fish_helix_goto_first_nonwhitespace + __fish_helix_extend_by_mode + + case goto_file_start __fish_helix_goto_line $count - end - case goto_last_line - commandline -f end-of-buffer beginning-of-line - __fish_helix_extend_by_mode - - case insert_mode - commandline -C (commandline -B || commandline -C) - set fish_bind_mode insert - commandline -f end-selection repaint-mode - - case append_mode - commandline -C (commandline -E || commandline -C) - set fish_bind_mode insert - commandline -f end-selection repaint-mode - - case prepend_to_line - __fish_helix_goto_first_nonwhitespace - set fish_bind_mode insert - commandline -f end-selection repaint-mode - - case append_to_line - set fish_bind_mode insert - commandline -f end-selection end-of-line repaint-mode - - case delete_selection - commandline -f kill-selection begin-selection - case delete_selection_noyank - __fish_helix_delete_selection - - case yank - __fish_helix_yank - case paste_before - __fish_helix_paste_before "commandline -f yank" - case paste_after - __fish_helix_paste_after "commandline -f yank" - case replace_selection - __fish_helix_replace_selection "$fish_killring[1]" "true" - - case paste_before_clip - __fish_helix_paste_before "fish_clipboard_paste" - case paste_after_clip - __fish_helix_paste_after "fish_clipboard_paste" --clip - case replace_selection_clip - __fish_helix_replace_selection "" "fish_clipboard_paste" --clip - - case select_all - commandline -f beginning-of-buffer begin-selection end-of-buffer end-of-line backward-char - - - case '*' - echo "[fish-helix]" Unknown command $command >&2 + case goto_line + if test "$count_defined" = 0 # if true + __fish_helix_goto_line $count + end + case goto_last_line + commandline -f end-of-buffer beginning-of-line + __fish_helix_extend_by_mode + + case insert_mode + commandline -C (commandline -B || commandline -C) + set fish_bind_mode insert + commandline -f end-selection repaint-mode + + case append_mode + commandline -C (commandline -E || commandline -C) + set fish_bind_mode insert + commandline -f end-selection repaint-mode + + case prepend_to_line + __fish_helix_goto_first_nonwhitespace + set fish_bind_mode insert + commandline -f end-selection repaint-mode + + case append_to_line + set fish_bind_mode insert + commandline -f end-selection end-of-line repaint-mode + + case delete_selection + commandline -f kill-selection begin-selection + case delete_selection_noyank + __fish_helix_delete_selection + + case yank + __fish_helix_yank + case paste_before + __fish_helix_paste_before "commandline -f yank" + case paste_after + __fish_helix_paste_after "commandline -f yank" + case replace_selection + __fish_helix_replace_selection "$fish_killring[1]" true + + case paste_before_clip + __fish_helix_paste_before fish_clipboard_paste + case paste_after_clip + __fish_helix_paste_after fish_clipboard_paste --clip + case replace_selection_clip + __fish_helix_replace_selection "" fish_clipboard_paste --clip + + case select_all + commandline -f beginning-of-buffer begin-selection end-of-buffer end-of-line backward-char + + case '*' + echo "[fish-helix]" Unknown command $command >&2 end end end @@ -193,11 +191,11 @@ end function __fish_helix_find_next_cr -a mode count skip set -l cursor (commandline -C) commandline | # Include endling newline intentionally - # Skip until cursor: - sed -z 's/^.\{'(math $cursor + $skip)'\}\(.*\)$/\\1/' | - # Count characters up to the target newline: - sed -z 's/^\(\([^\\n]*\\n\)\{0,'$count'\}\).*/\\1/' | - read -zl chars + # Skip until cursor: + sed -z 's/^.\{'(math $cursor + $skip)'\}\(.*\)$/\\1/' | + # Count characters up to the target newline: + sed -z 's/^\(\([^\\n]*\\n\)\{0,'$count'\}\).*/\\1/' | + read -zl chars if test $mode = default -a -n "$chars" commandline -f begin-selection @@ -210,13 +208,13 @@ end function __fish_helix_find_prev_cr -a mode count skip set -l cursor (commandline -C) commandline --cut-at-cursor | - sed -z 's/.\{'$skip'\}\n$//' | - read -zl buffer + sed -z 's/.\{'$skip'\}\n$//' | + read -zl buffer echo -n $buffer | - # Drop characters up to the target newline: - sed -z 's/\(\(\\n[^\\n]*\)\{0,'$count'\}\)$//' | - read -zl chars + # Drop characters up to the target newline: + sed -z 's/\(\(\\n[^\\n]*\)\{0,'$count'\}\)$//' | + read -zl chars set -l n_chars (math (string length -- "$buffer") - (string length -- "$chars")) if test $mode = default -a $n_chars != 0 @@ -294,11 +292,11 @@ end function __fish_helix_next_word -a mode count regex set -f cursor (commandline -C) commandline | - perl -e ' + perl -e ' use open qw(:std :utf8); do { local $/; substr <>, '$cursor' } =~ m/(?:'$regex'){0,'$count'}/ux; print $-[1], " ", $+[1];' | - read -f left right + read -f left right test "$left" = "$right" && return if test $mode = default commandline -C (math $cursor + $left) @@ -316,11 +314,11 @@ function __fish_helix_prev_word -a mode count regex set -f updated 0 for i in (seq 1 $count) commandline | - perl -e ' + perl -e ' use open qw(:std :utf8); do { local $/; substr <>, 0, '$left' } =~ /(?:'$regex')$/ux; print $-[1], " ", $+[1];' | - read -l l r + read -l l r test "$l" = "$r" -o "$l" = 0 -a "$r" = 1 && break set -f left $l set -f right $r @@ -342,8 +340,8 @@ function __fish_helix_delete_selection set start (commandline -B) set end (commandline -E) commandline | - sed -zE 's/^(.{'$start'})(.{0,'(math $end - $start)'})(.*)\\n$/\\1\\3/' | - read -l result + sed -zE 's/^(.{'$start'})(.{0,'(math $end - $start)'})(.*)\\n$/\\1\\3/' | + read -l result commandline "$result" commandline -C $start @@ -384,7 +382,7 @@ function __fish_helix_paste_after -a cmd_paste commandline -C $end $cmd_paste - if test "$argv[2]" = "--clip" + if test "$argv[2]" = --clip commandline -C (math $end - 1) else for i in (seq 0 (string length "$fish_killring[1]")) @@ -406,8 +404,8 @@ function __fish_helix_replace_selection -a replacement cmd_paste set start (commandline -B) set end (commandline -E) commandline | - sed -zE 's/^(.{'$start'})(.{0,'(math $end - $start)'})(.*)\\n$/\\1'"$(string escape --style=regex "$replacement")"'\\3/' | - read -l result + sed -zE 's/^(.{'$start'})(.{0,'(math $end - $start)'})(.*)\\n$/\\1'"$(string escape --style=regex "$replacement")"'\\3/' | + read -l result commandline "$result" commandline -C $start diff --git a/functions/fish_helix_key_bindings.fish b/functions/fish_helix_key_bindings.fish index c6aa397..62fb8ec 100644 --- a/functions/fish_helix_key_bindings.fish +++ b/functions/fish_helix_key_bindings.fish @@ -101,16 +101,15 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish bind -s --preset -M visual -m default $key repaint-mode end - # Motion and actions in normal/select mode for mode in default visual if test $mode = default - set -f n_begin_selection "begin-selection" # only begin-selection if current mode is Normal - set -f ns_move_extend "move" + set -f n_begin_selection begin-selection # only begin-selection if current mode is Normal + set -f ns_move_extend move set -f commandline_v_repaint "" else set -f n_begin_selection - set -f ns_move_extend "extend" + set -f ns_move_extend extend set -f commandline_v_repaint "commandline -f repaint-mode" end @@ -238,7 +237,6 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish bind -s --preset -M replace_one -m default \r 'commandline -f delete-char; commandline -i \n; commandline -f backward-char; commandline -f repaint-mode' bind -s --preset -M replace_one -m default \e cancel repaint-mode - ## FIXME Insert mode keys ## Old config from vi: @@ -259,36 +257,27 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish bind -s --preset -M insert -k sdc backward-delete-char # shifted delete bind -s --preset -M default -k sdc backward-delete-char # shifted delete - -# bind -s --preset '~' togglecase-char forward-single-char -# bind -s --preset gu downcase-word -# bind -s --preset gU upcase-word -# -# bind -s --preset J end-of-line delete-char -# bind -s --preset K 'man (commandline -t) 2>/dev/null; or echo -n \a' -# - - + # bind -s --preset '~' togglecase-char forward-single-char + # bind -s --preset gu downcase-word + # bind -s --preset gU upcase-word + # + # bind -s --preset J end-of-line delete-char + # bind -s --preset K 'man (commandline -t) 2>/dev/null; or echo -n \a' + # # same vim 'pasting' note as upper bind -s --preset '"*p' forward-char "commandline -i ( xsel -p; echo )[1]" bind -s --preset '"*P' "commandline -i ( xsel -p; echo )[1]" - - # # visual mode # - - # bind -s --preset -M visual -m insert c kill-selection end-selection repaint-mode # bind -s --preset -M visual -m insert s kill-selection end-selection repaint-mode bind -s --preset -M visual -m default '"*y' "fish_clipboard_copy; commandline -f end-selection repaint-mode" bind -s --preset -M visual -m default '~' togglecase-selection end-selection repaint-mode - - # Set the cursor shape # After executing once, this will have defined functions listening for the variable. # Therefore it needs to be before setting fish_bind_mode. From 7b14ab75d04bc95838809b972d6684b0718c0ff1 Mon Sep 17 00:00:00 2001 From: MunHammer Date: Tue, 21 Apr 2026 19:00:14 +1200 Subject: [PATCH 2/5] Fixed -k problems migrated -k key to just key & their corresponding modern codes --- functions/fish_helix_key_bindings.fish | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/functions/fish_helix_key_bindings.fish b/functions/fish_helix_key_bindings.fish index 62fb8ec..a5d6bfa 100644 --- a/functions/fish_helix_key_bindings.fish +++ b/functions/fish_helix_key_bindings.fish @@ -74,7 +74,7 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish # Closing a command substitution expands abbreviations bind -s --preset -M insert ")" self-insert expand-abbr # Ctrl-space inserts space without expanding abbrs - bind -s --preset -M insert -k nul 'commandline -i " "' + bind -s --preset -M insert ctrl-space 'commandline -i " "' # Switching to insert mode for mode in default visual @@ -118,16 +118,16 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish # FIXME example to bind 0 # FIXME backspace to edit count end - for key in h \e\[D \eOD "-k left" + for key in h \e\[D \eOD "left" bind -s --preset -M $mode $key "fish_helix_command "$ns_move_extend"_char_left" end - for key in l \e\[C \eOC "-k right" + for key in l \e\[C \eOC "right" bind -s --preset -M $mode $key "fish_helix_command "$ns_move_extend"_char_right" end - for key in k \e\[A \eOA "-k up" + for key in k \e\[A \eOA "up" bind -s --preset -M $mode $key "fish_helix_command char_up" end - for key in j \e\[B \eOB "-k down" + for key in j \e\[B \eOB "down" bind -s --preset -M $mode $key "fish_helix_command char_down" end @@ -155,10 +155,10 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish bind -s --preset -M $mode F$enter "fish_helix_command find_prev_cr" end - for key in gh \e\[H \eOH "-k home" + for key in gh \e\[H \eOH "home" bind -s --preset -M $mode $key "fish_helix_command goto_line_start" end - for key in gl \e\[F \eOF "-k end" + for key in gl \e\[F \eOF "end" bind -s --preset -M $mode $key "fish_helix_command goto_line_end" end bind -s --preset -M $mode gs "fish_helix_command goto_first_nonwhitespace" @@ -244,18 +244,18 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish # Vi moves the cursor back if, after deleting, it is at EOL. # To emulate that, move forward, then backward, which will be a NOP # if there is something to move forward to. - bind -s --preset -M insert -k dc delete-char forward-single-char backward-char - bind -s --preset -M default -k dc delete-char forward-single-char backward-char + bind -s --preset -M insert delete delete-char forward-single-char backward-char + bind -s --preset -M default delete delete-char forward-single-char backward-char # Backspace deletes a char in insert mode, but not in normal/default mode. - bind -s --preset -M insert -k backspace backward-delete-char - bind -s --preset -M default -k backspace backward-char + bind -s --preset -M insert backspace backward-delete-char + bind -s --preset -M default backspace backward-char bind -s --preset -M insert \ch backward-delete-char bind -s --preset -M default \ch backward-char bind -s --preset -M insert \x7f backward-delete-char bind -s --preset -M default \x7f backward-char - bind -s --preset -M insert -k sdc backward-delete-char # shifted delete - bind -s --preset -M default -k sdc backward-delete-char # shifted delete + bind -s --preset -M insert shift-delete backward-delete-char # shifted delete + bind -s --preset -M default shift-delete backward-delete-char # shifted delete # bind -s --preset '~' togglecase-char forward-single-char # bind -s --preset gu downcase-word From 0b7e3d3b70b7660954c77e29bbc864fe4416ba74 Mon Sep 17 00:00:00 2001 From: MunHammer Date: Tue, 21 Apr 2026 19:01:02 +1200 Subject: [PATCH 3/5] Fixed the escape codes --- functions/fish_helix_key_bindings.fish | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/functions/fish_helix_key_bindings.fish b/functions/fish_helix_key_bindings.fish index a5d6bfa..c4808e3 100644 --- a/functions/fish_helix_key_bindings.fish +++ b/functions/fish_helix_key_bindings.fish @@ -146,13 +146,13 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish bind -s --preset -M $mode t\e "" bind -s --preset -M $mode f\e "" bind -s --preset -M $mode T\e "" - bind -s --preset -M $mode F\e "" + bind -s --preset -M $mode alt-f "" for enter in \r \n - bind -s --preset -M $mode t$enter "fish_helix_command till_next_cr" - bind -s --preset -M $mode f$enter "fish_helix_command find_next_cr" - bind -s --preset -M $mode T$enter "fish_helix_command till_prev_cr" - bind -s --preset -M $mode F$enter "fish_helix_command find_prev_cr" + bind -s --preset -M $mode "t,$enter" "fish_helix_command till_next_cr" + bind -s --preset -M $mode "f,$enter" "fish_helix_command find_next_cr" + bind -s --preset -M $mode "T,$enter" "fish_helix_command till_prev_cr" + bind -s --preset -M $mode "F,$enter" "fish_helix_command find_prev_cr" end for key in gh \e\[H \eOH "home" From 35b148850da5df5ef7edd34c295d904a2b7da24c Mon Sep 17 00:00:00 2001 From: MunHammer Date: Tue, 21 Apr 2026 19:01:39 +1200 Subject: [PATCH 4/5] Fixed ~ shell expansions --- functions/fish_helix_key_bindings.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/fish_helix_key_bindings.fish b/functions/fish_helix_key_bindings.fish index c4808e3..26fa8bd 100644 --- a/functions/fish_helix_key_bindings.fish +++ b/functions/fish_helix_key_bindings.fish @@ -197,7 +197,7 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish bind -s --preset -M $mode " R" "fish_helix_command replace_selection_clip" # FIXME keep selection - bind -s --preset -M $mode ~ togglecase-selection + bind -s --preset -M $mode '~' togglecase-selection # FIXME ` and \e` # FIXME . From 07b41e0f6aa95793329b19807d036708f309eebc Mon Sep 17 00:00:00 2001 From: MunHammer Date: Tue, 21 Apr 2026 19:02:30 +1200 Subject: [PATCH 5/5] Ran it through the formatter --- functions/fish_helix_key_bindings.fish | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/functions/fish_helix_key_bindings.fish b/functions/fish_helix_key_bindings.fish index 26fa8bd..29851f0 100644 --- a/functions/fish_helix_key_bindings.fish +++ b/functions/fish_helix_key_bindings.fish @@ -118,16 +118,16 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish # FIXME example to bind 0 # FIXME backspace to edit count end - for key in h \e\[D \eOD "left" + for key in h \e\[D \eOD left bind -s --preset -M $mode $key "fish_helix_command "$ns_move_extend"_char_left" end - for key in l \e\[C \eOC "right" + for key in l \e\[C \eOC right bind -s --preset -M $mode $key "fish_helix_command "$ns_move_extend"_char_right" end - for key in k \e\[A \eOA "up" + for key in k \e\[A \eOA up bind -s --preset -M $mode $key "fish_helix_command char_up" end - for key in j \e\[B \eOB "down" + for key in j \e\[B \eOB down bind -s --preset -M $mode $key "fish_helix_command char_down" end @@ -155,10 +155,10 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish bind -s --preset -M $mode "F,$enter" "fish_helix_command find_prev_cr" end - for key in gh \e\[H \eOH "home" + for key in gh \e\[H \eOH home bind -s --preset -M $mode $key "fish_helix_command goto_line_start" end - for key in gl \e\[F \eOF "end" + for key in gl \e\[F \eOF end bind -s --preset -M $mode $key "fish_helix_command goto_line_end" end bind -s --preset -M $mode gs "fish_helix_command goto_first_nonwhitespace"