Replies: 1 comment 1 reply
-
I think this custom command will do what you want: require("neo-tree").setup({
filesystem = {
window = {
mappings = {
["a"] = function(state)
local fs_actions = require("neo-tree.sources.filesystem.lib.fs_actions")
local fs = require("neo-tree.sources.filesystem")
local node = state.tree:get_node()
local in_directory = node:get_parent_id() or node:get_id()
local using_root_directory = state.path
local callback = function(path)
fs.show_new_children(state, path)
end
fs_actions.create_node(in_directory, callback, using_root_directory)
end,
}
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey people 👋🏾
I'm new to
neo-tree.nvim
and switching fromnvim-tree.lua
. A behavior I'm used to and where I think it makes sense is the adding a sibling feature. In fact if I call the "add" function, the relative path I'm adding to is the parent of the node under my cursor. So if my cursor is on a folder, I add to the parent of this folder (e.g. a new folder as sibling to the one under the cursor). In fact like if I'm on a file node, adding something will make it relative to the parent directory of this file.My current workaround is a custom mapping that moves the cursor to the parent node and then I add something. Though I could extend this to also call the add function here. Though this whole custom code isn't perfect and I wanted to ask if someone thinks this could become a new optional behavior. What do you guys think?
Beta Was this translation helpful? Give feedback.
All reactions