How to prevent FzfLua from replacing current buffer when opening files? #2318
Replies: 3 comments 6 replies
-
I guess neo-tree did some proxy to set buffer again.
I didn't get it. isn't this feasible via action,,,? |
Beta Was this translation helpful? Give feedback.
-
Oh. I see, you want to open in another "existing" window, but not creating window fzf-lua won't do this for you unless you write an action (where you get your selected entry and do anything you want). an action is your logic to handle "open". |
Beta Was this translation helpful? Give feedback.
-
EDIT: i have an idea, maybe you can find neo-tree window in find_my_win... local find_my_win = function()
end
local open = function(selected, opts)
vim.api.nvim_win_call(find_my_win(), function() require('fzf-lua.actions').vimcmd_entry('', edit, selected, opts, true) end)
end
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I’m using Neovim with
fzf-lua
and I ran into a question about window behavior.When I run
:FzfLua oldfiles
and select a file,fzf-lua
replaces the buffer in the current window with the selected file. I don’t want this replacement.I tried setting
winfixbuf
, but then the behavior changes: instead of replacing the buffer,fzf-lua
creates a new split window and opens the file there.I know I could solve this with a custom action, but here’s the interesting part:
neo-tree
window or a terminal buffer,fzf-lua
does not replace those buffers. Instead, it automatically finds another suitable window and opens the file there.Question:
👉 Is there a way to configure
fzf-lua
to always use this “open in another window” behavior (like it does forneo-tree
or terminal), without writing a custom action?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions