Async open nvim-tree on startup? #2002
linrongbin16
started this conversation in
Ideas
Replies: 1 comment
-
The 30ms is not surprising: nvim-tree will enumerate the file system, git, diagnostics etc. I'm not sure why that feels smoother; as you say the end to end time is the same. Perhaps the ordering changes around updating statusline, other windows/plugins etc. contribute to this. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm using nvim-tree with lazy.nvim, and my config open nvim-tree on startup for a directory.
Here's my 1st-edition auto-open nvim-tree on startup augroup:
And in lazy's profile, I found


nvim_tree_augroup
cost ~30ms.Guess the most heavy part is
cd
directory andnvim-tree.api.open
API call.So I use
vim.defer_fn
API to wrap this part(with 0ms delay), here's the 2nd-edition:Here's the lazy's profile:


The interesting thing is: total time is almost the same,
nvim_tree_augroup
time is reduced < 0.1ms. My eyes feel that it's much faster and smooth.I'm not sure why is that?
Beta Was this translation helpful? Give feedback.
All reactions