Open file without leaving neo-tree #919
Closed
dpetka2001
started this conversation in
General
Replies: 1 comment 2 replies
-
No, by default. Neotree uses a simple However, if you use a callback, you would be able to achieve what you want. event_handlers = {
{
event = "file_opened",
handler = function(_)
vim.cmd([[Neotree focus]])
end,
},
} Or another option is to make a new keybind since with the above callback, you'll never be able to escape neo-tree easily. filesystem = {
window = {
mappings = {
["L"] = "open_nofocus",
},
},
commands = {
open_nofocus = function(state)
require("neo-tree.sources.filesystem.commands").open(state)
vim.schedule(function()
vim.cmd([[Neotree focus]])
end)
end,
},
}, |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As the title says, is it possible to open a file from neo-tree and keep the focus in neo-tree buffer? Currently when i open a file it changes focus to that buffer.
Beta Was this translation helpful? Give feedback.
All reactions