Replies: 3 comments 3 replies
-
These options might enable the behaviour you desire: |
Beta Was this translation helpful? Give feedback.
-
Hi, if i'm not mistaken, this is not what i want. I use api.tree.change_root_to_node() to quickly change the Path between different directories in my Session for search / grep Operations (with Telescope find_files and other functions). But i want to change pwd without changing the root node for the tree. Does this makes sense? I was working that way in Nerdtree (and neo-tree as well if i remember correctly) |
Beta Was this translation helpful? Give feedback.
-
I have same issue as you, but for your case, I think you can try with setting |
Beta Was this translation helpful? Give feedback.
-
Description
Hi,
if i invoke change_root_to_node(), buffers still use the old working directory while the nvim-tree buffer itself has the new working directory.
My Quick Fix for this:
-- change_root_to_node will not change pwd for other buffers,
-- so i set it in this function
local api = require("nvim-tree.api")
vim.keymap.set("n", "<C-]>", function()
local node = api.tree.get_node_under_cursor()
api.tree.change_root_to_node()
vim.api.nvim_set_current_dir(node.absolute_path)
end, opts("CD"))
Neovim version
Operating system and version
Linux 6.3.12-1-MANJARO
nvim-tree version
a708bd2
Clean room replication
Steps to reproduce
just invoke the funktion, then use
:pwd
in Nvim-tree Buffer vs in other buffers
Expected behavior
No response
Actual behavior
No response
Beta Was this translation helpful? Give feedback.
All reactions