mirror of
https://github.com/XNM1/linux-nixos-hyprland-config-dotfiles.git
synced 2025-09-15 09:45:58 +03:00
fix(fish-helix): 🐛 Fix argparse syntax and add select_line command
- Remove single quotes around `h/help` flag in argparse call - Add new `select_line` command case to handle line selection - Clean up string quoting consistency throughout the function - Improve indentation and formatting for better readability The argparse syntax fix resolves potential parsing issues while the new select_line command provides consistent line selection behavior across different modes.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -220,6 +219,8 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish
|
||||
|
||||
bind -s --preset -M $mode % "fish_helix_command select_all"
|
||||
|
||||
bind -s --preset -M $mode x "fish_helix_command select_line"
|
||||
|
||||
# FIXME x X \ex
|
||||
# FIXME J
|
||||
# FIXME \cc
|
||||
@@ -238,7 +239,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 +259,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.
|
||||
|
Reference in New Issue
Block a user