neo-tree.nvim icon indicating copy to clipboard operation
neo-tree.nvim copied to clipboard

QUESTION: Is there a way to keep the cursor in its current position when opening a new window?

Open zebra-f opened this issue 4 months ago • 0 comments

Normally cursor jumps to a newly opened window, but I would like it to stay in its current location (i.e Neotree). Can't find anything in the docs. I've also tried this workaround

...
        event_handlers = {
          {
            event = "file_open_requested",
            handler = function()
              require("neo-tree.command").execute({ action = "close" })
              vim.cmd("Neotree")
            end
          },
        }
...

but it doesn't work as expected. It opens the tree, but the cursor stays where it was, even though, this:

...
            handler = function()
              require("neo-tree.command").execute({ action = "close" })
              -- vim.cmd("Neotree")
            end
...

+ :Neotree would work.

zebra-f avatar Oct 12 '24 00:10 zebra-f