mirror of
https://github.com/XNM1/linux-nixos-hyprland-config-dotfiles.git
synced 2025-09-15 09:45:58 +03:00

Add comprehensive helix-like modal key bindings system for fish shell with: - New `fish_helix_key_bindings` function with helix-inspired navigation - Modal editing support with count modifiers via `fish_bind_count` - Visual mode prompt indicator via `fish_default_mode_prompt` - Enhanced clipboard integration with proper notification formatting The implementation provides vim/helix-style modal editing while maintaining fish shell compatibility and includes proper mode indicators, count tracking, and seamless integration with existing fish key binding systems.
28 lines
825 B
Fish
28 lines
825 B
Fish
function fish_bind_count
|
|
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"
|
|
echo "Usage: $0 [-h] [-z] [DIGITS ...]"
|
|
return
|
|
end
|
|
if test -n "$_flag_zero" || not string match -rq '[1-9]\d*' "$fish_bind_count"
|
|
set -g fish_bind_count 0
|
|
end
|
|
# Iterate over given digits
|
|
for arg in $argv
|
|
for digit in (string split '' "$arg")
|
|
set -g fish_bind_count $(math "$fish_bind_count" \* 10 \+ "$digit")
|
|
end
|
|
end
|
|
if test -n "$_flag_read"
|
|
set -l count "$fish_bind_count"
|
|
set -g fish_bind_count 0
|
|
if test "$count" = 0
|
|
echo 1
|
|
return 1
|
|
else
|
|
echo "$count"
|
|
end
|
|
end
|
|
end |