Hi,
After much searching and trying various solutions posted in forums, I have been unable to get the :Lines command to allow me to jump to an existing tab when the chosen file is already open in another tab. Is there any way to do this? I tried setting g:fzf_buffers_jump = 1 but that does not seem to help. I also tried various things with g:fzf_action but couldn't make that work given the implementation of s:line_handler. Can someone suggest a way? Here is the current implementation of the s:line_handler:
function! s:line_handler(lines)
if len(a:lines) < 2
return
endif
normal! m'
let cmd = s:action_for(a:lines[0])
if !empty(cmd) && stridx('edit', cmd) < 0
execute 'silent' cmd
endif
let keys = split(a:lines[1], '\t')
execute 'buffer' keys[0]
execute keys[2]
normal! ^zvzz
endfunction
but as can be seen, the execute 'silent' cmd, while it will execute a command that I put into g:fzf_action, does not allow passing the name of the file selected, so I can't write a custom function to e.g. find the tab and select it (by calling tab drop) since a filename is needed. Can someone help?
Hi,
After much searching and trying various solutions posted in forums, I have been unable to get the
:Linescommand to allow me to jump to an existing tab when the chosen file is already open in another tab. Is there any way to do this? I tried settingg:fzf_buffers_jump = 1but that does not seem to help. I also tried various things withg:fzf_actionbut couldn't make that work given the implementation ofs:line_handler. Can someone suggest a way? Here is the current implementation of thes:line_handler:but as can be seen, the
execute 'silent' cmd, while it will execute a command that I put intog:fzf_action, does not allow passing the name of the file selected, so I can't write a custom function to e.g. find the tab and select it (by callingtab drop) since a filename is needed. Can someone help?man fzf)