lf icon indicating copy to clipboard operation
lf copied to clipboard

Integration with z.lua ?

Open SamDc73 opened this issue 2 years ago • 4 comments

for z.lua integration with ranger there is this extension to achieve that, is there any similar project to achieve that in lf ?

SamDc73 avatar May 09 '22 16:05 SamDc73

You could try this cmd (set ZLUA_ROOT path properly):

cmd zl ${{
result="$(read '?Dir: ' input && $ZLUA_ROOT/z.lua -I -e $input)"
[[ -z "$result" ]] && read '?No directory. Press Enter to continue' || lf -remote "send ${id} cd '${result}'"
}}

Note: I'm using read from zsh.

zhengpd avatar May 18 '22 09:05 zhengpd

I'm having this error message : --: line 3: read: ?Dir: ': not a valid identifier`

ghost avatar May 19 '22 12:05 ghost

@SamDc73 You might be using bash. Try read -p 'Dir: '. The read '?Dir: ' syntax works with zsh.

zhengpd avatar May 19 '22 14:05 zhengpd

It works

cmd z-jump ${{
  z_exe="$HOME/.local/share/zinit/plugins/skywind3000---z.lua/z.lua"
  lf -remote "send ${id} cd '$($z_exe -I -e $1)'"
}}
map Z push :z-jump<space>

pu-007 avatar Jul 17 '22 06:07 pu-007

This is now listed in the integrations section of the wiki. I think this issue can be closed.

joelim-work avatar Sep 04 '23 15:09 joelim-work