feat(keybindings): scorciatoie fg-select, clear-repeat e palette
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
function __fg_select --description 'Bring a background/stopped job to foreground, picking via fzf when multiple'
|
||||
set -l jobs_list (jobs | string match -r '^[0-9]+\t.*')
|
||||
set -l n (count $jobs_list)
|
||||
if test $n -eq 0
|
||||
echo 'no background jobs' >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
set -l picked
|
||||
if test $n -eq 1
|
||||
set picked $jobs_list[1]
|
||||
else
|
||||
set picked (printf '%s\n' $jobs_list | fzf --no-multi --prompt='fg> ')
|
||||
or return 1
|
||||
end
|
||||
|
||||
set -l id (string match -r '^([0-9]+)\t' -- $picked)[2]
|
||||
fg %$id
|
||||
end
|
||||
Reference in New Issue
Block a user