file_switch_or_edit and buf_switch_or_edit only switches within the current window/tab? #1997
-
Hi, just trying to work out how these options work. Forgive me if I'm misunderstanding them. :) Let's say I have a.ts and b.ts open in a split in a tab, and c.ts open in a second tab:
Let's say I run But if I run Running Is there a way to combine these behaviours? Focus the existing open split if a file is already opened, and if it's not opened, open the file? I also want to accomplish this for the tabedit, split, and vsplit options. I've tried the following, but it exhibits the same behaviour as described above:
Looking at the implementation, maybe this requires a tabs + files command where tabs are preferred and it falls back to files if not found? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
I know there's a |
Beta Was this translation helpful? Give feedback.
-
I test a bit, I think it work well: ['enter'] = function(sel, o)
local entry = require('fzf-lua.path').entry_to_file(sel[1], o, o._uri)
local fullpath = entry.bufname or entry.uri and entry.uri:match("^%a+://(.*)") or entry.path
vim.cmd(([[drop %s]]):format(fullpath))
end, |
Beta Was this translation helpful? Give feedback.
I test a bit, I think it work well: