<Tab> key no longer opens directories, only previews, after recent update #2027
-
Hello! I've normally used Instead,
When I tried remapping How would I remap this to get my original functionality of previewing files and opening/closing directories? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That was actually a bug; "preview" would open file when it was on a directory, in this case expanding the directory. Here's a function you can map to achieve this behaviour via action_cb: local function preview_or_toggle_dir(node)
local api = require("nvim-tree.api")
if node.type == "file" or node.type == "link" then
api.node.open.preview(node)
else
api.node.open.edit(node)
end
end P.S. please see https://github.com/nvim-tree/nvim-tree.lua/wiki/Migrating-To-on_attach to migrate your mappings to a simple |
Beta Was this translation helpful? Give feedback.
That was actually a bug; "preview" would open file when it was on a directory, in this case expanding the directory.
Here's a function you can map to achieve this behaviour via action_cb:
P.…