jump: use gum
This commit is contained in:
parent
4336b974a4
commit
75d95fe20e
|
@ -36,8 +36,13 @@ in {
|
|||
programs = let
|
||||
rcScript = ''
|
||||
function jump {
|
||||
if test -z "$1"; then
|
||||
test -n "$_JUMP_RECURSE" && return 1
|
||||
_JUMP_RECURSE=1 jump "$(${lib.getExe pkgs.fd} . "$_JUMP_MARKPATH" --type l -X ${lib.getExe pkgs.gum} choose --ordered {/})"
|
||||
else
|
||||
pushd . > /dev/null
|
||||
cd -P "$_JUMP_MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
|
||||
fi
|
||||
}
|
||||
function mark {
|
||||
mkdir -p "$_JUMP_MARKPATH" &&
|
||||
|
@ -55,7 +60,7 @@ in {
|
|||
}
|
||||
_complete_jump_marks() {
|
||||
local curw=''${COMP_WORDS[COMP_CWORD]}
|
||||
local wordlist=$(find $_JUMP_MARKPATH -type l -printf "%f\n")
|
||||
local wordlist=$(find "$_JUMP_MARKPATH" -type l -printf "%f\n")
|
||||
COMPREPLY=($(compgen -W ''\'''${wordlist[@]}' -- "$curw"))
|
||||
return 0
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue