#!/usr/bin/env fish # Yes, I know this is a monstrosity of a script # We could do this via some sequence of character and a for loop # But that would require defining an alias, and I kinda just don't want to introduce loading a function # Feel free to PR if you'd rather use that! # All of these are meant for fish normal mode (with fish_vi_key_bindings) # This can just as easily be done in default, emacs-like fish shell keybind mode # The difference would just be that you'd use a hotkey with a modifier to start a get or update sequence bind "'a" 'cd "$(harp get cd_harps a --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'b" 'cd "$(harp get cd_harps b --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'c" 'cd "$(harp get cd_harps c --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'d" 'cd "$(harp get cd_harps d --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'e" 'cd "$(harp get cd_harps e --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'f" 'cd "$(harp get cd_harps f --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'g" 'cd "$(harp get cd_harps g --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'h" 'cd "$(harp get cd_harps h --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'i" 'cd "$(harp get cd_harps i --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'j" 'cd "$(harp get cd_harps j --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'k" 'cd "$(harp get cd_harps k --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'l" 'cd "$(harp get cd_harps l --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'m" 'cd "$(harp get cd_harps m --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'n" 'cd "$(harp get cd_harps n --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'o" 'cd "$(harp get cd_harps o --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'p" 'cd "$(harp get cd_harps p --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'q" 'cd "$(harp get cd_harps q --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'r" 'cd "$(harp get cd_harps r --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'s" 'cd "$(harp get cd_harps s --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'t" 'cd "$(harp get cd_harps t --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'u" 'cd "$(harp get cd_harps u --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'v" 'cd "$(harp get cd_harps v --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'w" 'cd "$(harp get cd_harps w --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'x" 'cd "$(harp get cd_harps x --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'y" 'cd "$(harp get cd_harps y --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'z" 'cd "$(harp get cd_harps z --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'A" 'cd "$(harp get cd_harps A --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'B" 'cd "$(harp get cd_harps B --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'C" 'cd "$(harp get cd_harps C --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'D" 'cd "$(harp get cd_harps D --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'E" 'cd "$(harp get cd_harps E --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'F" 'cd "$(harp get cd_harps F --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'G" 'cd "$(harp get cd_harps G --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'H" 'cd "$(harp get cd_harps H --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'I" 'cd "$(harp get cd_harps I --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'J" 'cd "$(harp get cd_harps J --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'K" 'cd "$(harp get cd_harps K --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'L" 'cd "$(harp get cd_harps L --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'M" 'cd "$(harp get cd_harps M --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'N" 'cd "$(harp get cd_harps N --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'O" 'cd "$(harp get cd_harps O --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'P" 'cd "$(harp get cd_harps P --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'Q" 'cd "$(harp get cd_harps Q --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'R" 'cd "$(harp get cd_harps R --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'S" 'cd "$(harp get cd_harps S --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'T" 'cd "$(harp get cd_harps T --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'U" 'cd "$(harp get cd_harps U --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'V" 'cd "$(harp get cd_harps V --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'W" 'cd "$(harp get cd_harps W --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'X" 'cd "$(harp get cd_harps X --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'Y" 'cd "$(harp get cd_harps Y --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'Z" 'cd "$(harp get cd_harps Z --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'1" 'cd "$(harp get cd_harps 1 --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'2" 'cd "$(harp get cd_harps 2 --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'3" 'cd "$(harp get cd_harps 3 --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'4" 'cd "$(harp get cd_harps 4 --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'5" 'cd "$(harp get cd_harps 5 --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'6" 'cd "$(harp get cd_harps 6 --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'7" 'cd "$(harp get cd_harps 7 --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'8" 'cd "$(harp get cd_harps 8 --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'9" 'cd "$(harp get cd_harps 9 --path | string replace \\~ $HOME)" ; commandline -f repaint' bind "'0" 'cd "$(harp get cd_harps 0 --path | string replace \\~ $HOME)" ; commandline -f repaint' bind 'ma' 'harp update cd_harps a --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark a ; commandline -f repaint' bind 'mb' 'harp update cd_harps b --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark b ; commandline -f repaint' bind 'mc' 'harp update cd_harps c --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark c ; commandline -f repaint' bind 'md' 'harp update cd_harps d --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark d ; commandline -f repaint' bind 'me' 'harp update cd_harps e --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark e ; commandline -f repaint' bind 'mf' 'harp update cd_harps f --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark f ; commandline -f repaint' bind 'mg' 'harp update cd_harps g --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark g ; commandline -f repaint' bind 'mh' 'harp update cd_harps h --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark h ; commandline -f repaint' bind 'mi' 'harp update cd_harps i --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark i ; commandline -f repaint' bind 'mj' 'harp update cd_harps j --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark j ; commandline -f repaint' bind 'mk' 'harp update cd_harps k --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark k ; commandline -f repaint' bind 'ml' 'harp update cd_harps l --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark l ; commandline -f repaint' bind 'mm' 'harp update cd_harps m --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark m ; commandline -f repaint' bind 'mn' 'harp update cd_harps n --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark n ; commandline -f repaint' bind 'mo' 'harp update cd_harps o --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark o ; commandline -f repaint' bind 'mp' 'harp update cd_harps p --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark p ; commandline -f repaint' bind 'mq' 'harp update cd_harps q --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark q ; commandline -f repaint' bind 'mr' 'harp update cd_harps r --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark r ; commandline -f repaint' bind 'ms' 'harp update cd_harps s --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark s ; commandline -f repaint' bind 'mt' 'harp update cd_harps t --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark t ; commandline -f repaint' bind 'mu' 'harp update cd_harps u --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark u ; commandline -f repaint' bind 'mv' 'harp update cd_harps v --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark v ; commandline -f repaint' bind 'mw' 'harp update cd_harps w --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark w ; commandline -f repaint' bind 'mx' 'harp update cd_harps x --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark x ; commandline -f repaint' bind 'my' 'harp update cd_harps y --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark y ; commandline -f repaint' bind 'mz' 'harp update cd_harps z --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark z ; commandline -f repaint' bind 'mA' 'harp update cd_harps A --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark A ; commandline -f repaint' bind 'mB' 'harp update cd_harps B --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark B ; commandline -f repaint' bind 'mC' 'harp update cd_harps C --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark C ; commandline -f repaint' bind 'mD' 'harp update cd_harps D --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark D ; commandline -f repaint' bind 'mE' 'harp update cd_harps E --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark E ; commandline -f repaint' bind 'mF' 'harp update cd_harps F --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark F ; commandline -f repaint' bind 'mG' 'harp update cd_harps G --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark G ; commandline -f repaint' bind 'mH' 'harp update cd_harps H --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark H ; commandline -f repaint' bind 'mI' 'harp update cd_harps I --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark I ; commandline -f repaint' bind 'mJ' 'harp update cd_harps J --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark J ; commandline -f repaint' bind 'mK' 'harp update cd_harps K --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark K ; commandline -f repaint' bind 'mL' 'harp update cd_harps L --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark L ; commandline -f repaint' bind 'mM' 'harp update cd_harps M --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark M ; commandline -f repaint' bind 'mN' 'harp update cd_harps N --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark N ; commandline -f repaint' bind 'mO' 'harp update cd_harps O --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark O ; commandline -f repaint' bind 'mP' 'harp update cd_harps P --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark P ; commandline -f repaint' bind 'mQ' 'harp update cd_harps Q --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark Q ; commandline -f repaint' bind 'mR' 'harp update cd_harps R --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark R ; commandline -f repaint' bind 'mS' 'harp update cd_harps S --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark S ; commandline -f repaint' bind 'mT' 'harp update cd_harps T --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark T ; commandline -f repaint' bind 'mU' 'harp update cd_harps U --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark U ; commandline -f repaint' bind 'mV' 'harp update cd_harps V --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark V ; commandline -f repaint' bind 'mW' 'harp update cd_harps W --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark W ; commandline -f repaint' bind 'mX' 'harp update cd_harps X --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark X ; commandline -f repaint' bind 'mY' 'harp update cd_harps Y --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark Y ; commandline -f repaint' bind 'mZ' 'harp update cd_harps Z --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark Z ; commandline -f repaint' bind 'm1' 'harp update cd_harps 1 --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark 1 ; commandline -f repaint' bind 'm2' 'harp update cd_harps 2 --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark 2 ; commandline -f repaint' bind 'm3' 'harp update cd_harps 3 --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark 3 ; commandline -f repaint' bind 'm4' 'harp update cd_harps 4 --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark 4 ; commandline -f repaint' bind 'm5' 'harp update cd_harps 5 --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark 5 ; commandline -f repaint' bind 'm6' 'harp update cd_harps 6 --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark 6 ; commandline -f repaint' bind 'm7' 'harp update cd_harps 7 --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark 7 ; commandline -f repaint' bind 'm8' 'harp update cd_harps 8 --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark 8 ; commandline -f repaint' bind 'm9' 'harp update cd_harps 9 --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark 9 ; commandline -f repaint' bind 'm0' 'harp update cd_harps 0 --path "$(pwd | string replace $HOME \\~)" ; echo set bookmark 0 ; commandline -f repaint'