grace/dots
dotfiles/nix configs
git clone https://git.gae.moe/grace/dots
9c3d491
main
1function fish_bind_count 2argparse h/help z/zero r/read --$argv 3or return 1 4if test -n " $_flag_help " 5echo "Helper function to track count modifier with modal key bindings" 6echo "Usage: $0 [-h] [-z] [DIGITS ...]" 7return 8end 9if test -n " $_flag_zero " || not string match-rq '[1-9]\d*' " $fish_bind_count " 10set -g fish_bind_count 0 11end 12# Iterate over given digits 13for argin $argv 14for digitin ( string split'' " $arg " ) 15set -g fish_bind_count$( math " $fish_bind_count " \* 10\+ " $digit " ) 16end 17end 18if test -n " $_flag_read " 19set -l count" $fish_bind_count " 20set -g fish_bind_count 0 21if test " $count " = 0 22echo 1 23return 1 24else 25echo " $count " 26end 27end 28end