feat(keybindings): scorciatoie fg-select, clear-repeat e palette
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
function __clear_repeat_loop --description "Re-run the last command on a timer, clearing the screen each iteration"
|
||||
set -l last $history[1]
|
||||
or return
|
||||
|
||||
read -l -P "Ripeti quante volte? (invio = infinito) " count
|
||||
read -l -P "Ogni quanti secondi? (default 2) " sec
|
||||
set -l sec (string match -r '^[0-9]+$' -- $sec)
|
||||
or set sec 2
|
||||
|
||||
if test -z "$count"; or test "$count" -eq 0
|
||||
while true
|
||||
clear
|
||||
eval $last
|
||||
sleep $sec
|
||||
end
|
||||
else
|
||||
for i in (seq $count)
|
||||
clear
|
||||
eval $last
|
||||
sleep $sec
|
||||
end
|
||||
end
|
||||
|
||||
commandline -f repaint
|
||||
end
|
||||
Reference in New Issue
Block a user