Silently open a new tab #1875
Replies: 9 comments
-
To confirm:
You should be able to do that yourself with a custom action, see If you can't please reopen / comment. |
Beta Was this translation helpful? Give feedback.
-
I'm pretty new to lua. Can you show me the code? |
Beta Was this translation helpful? Give feedback.
-
Take a look at the recipes linked above. Fix tab titles when opening file in new tab might be a good start. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much! I will do that. But I do believe that it will be much helpful if this mapping is in the official code. |
Beta Was this translation helpful? Give feedback.
-
We are no longer adding specific new functionality: https://github.com/nvim-tree/nvim-tree.lua#roadmap nvim-tree has suffered from feature creep and will only add QOL features that cannot be achieved via API. |
Beta Was this translation helpful? Give feedback.
-
If not, can you please provide the config? I believe this feature is super useful for many users. |
Beta Was this translation helpful? Give feedback.
-
Here's a quick implementation. You might need to tweak it a bit to better suit your needs. local function open_tab_silent(node)
local api = require("nvim-tree.api")
api.node.open.tab(node)
vim.cmd.tabprev()
end
---
mappings = {
list = {
{ key = "ts", action = "open_tab_silent", action_cb = open_tab_silent }, |
Beta Was this translation helpful? Give feedback.
-
Thank you so much! |
Beta Was this translation helpful? Give feedback.
-
Glad to hear this worked. Could you please add your final solution to the Recipes page? I don't think the draft works very well around multiple tabs... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Please add an option to open a tab (when pressing ) silently. That is, staying on the current buffer rather than jumping to new tab's buffer.
Suggestion: create a new mapping to this new feature.
Beta Was this translation helpful? Give feedback.
All reactions