-
-
Notifications
You must be signed in to change notification settings - Fork 624
Hangs on saving #389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
i'm really not sure what this is about. Are you sure this comes from nvim-tree ? Your tree is not even opened so this seems strange to me |
Yes, just after the include with the packer this happens 😞 so unfortunately yes ... after dropping this plugin, everything looks fine. Can I help with some additional info? |
hm, maybe a minimal init so i can reproduce ? and your neovim version :) |
sure thing :) nvim tree_cb = require'nvim-tree.config'.nvim_tree_callback
vim.g.nvim_tree_bindings = {
["<CR>"] = tree_cb("edit"),
["<C-CR>"] = tree_cb("cd"),
["<C-v>"] = tree_cb("vsplit"),
["<C-x>"] = tree_cb("split"),
["<C-t>"] = tree_cb("tabnew"),
["<BS>"] = tree_cb("close_node"),
["<S-CR>"] = tree_cb("close_node"),
["<Tab>"] = tree_cb("preview"),
["I"] = tree_cb("toggle_ignored"),
["H"] = tree_cb("toggle_dotfiles"),
["R"] = tree_cb("refresh"),
["a"] = tree_cb("create"),
["d"] = tree_cb("remove"),
["r"] = tree_cb("rename"),
["<C-r>"] = tree_cb("full_rename"),
["x"] = tree_cb("cut"),
["c"] = tree_cb("copy"),
["p"] = tree_cb("paste"),
["-"] = tree_cb("dir_up"),
["q"] = tree_cb("close"),
}
vim.g.nvim_tree_side = 'left'
vim.g.nvim_tree_width = 30
vim.g.nvim_tree_ignore = {
'.git', 'node_modules', 'dist', '.cache'
}
vim.g.nvim_tree_auto_open = 0
vim.g.nvim_tree_auto_close = 0
vim.g.nvim_tree_follow = 1
vim.g.nvim_tree_indent_markers = 1
vim.g.nvim_tree_hide_dotfiles = 1
vim.g.nvim_tree_git_hl = 1
vim.g.nvim_tree_root_folder_modifier = ':~'
vim.g.nvim_tree_tab_open = 0
vim.g.nvim_tree_show_icons = {git = 0, folders = 1, files = 0}
vim.g.nvim_tree_icons = {
symlink = '',
git = {
unstaged = "✗",
staged = "✓",
unmerged = "",
renamed = "➜",
untracked = "★"
},
-- folder = {default = "", open = " "}
folder = {
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
symlink_open = "",
},
} |
i cannot reproduce the lag :/ seems weird that this is nvim-tree related, could you disable the ligne 15 in |
Same here, happens when git integration is enabled. Try to disable it ( |
thanks! Thats it ... thanks @kyazdani42 for investigation and this great plugin 🥇 🙏🏾 |
git integration could indeed slow down the plugin as it's using cli commands (and i'm not sure how fast cli commands happen but they are usually slower than libraries). If something like https://github.com/libgit2/luagit2 can be integrated at some point that would be nicer i suppose |
I have the same issue with everything updated to the latest versions. Saving a file pauses everything for 1-2s. Opening neovim is slow too (~1.5s), but it's not captured by Also worth mentioning that this happens when opening neovim inside a large repository (even without opening a file). Opening neovim in my home dir or my config dir does not show the same behaviour.
This did not work for me, it was already disabled. Is there any other setup parameter that makes use of CLI commands? I'll try making a minimal reproducible config. I'm on |
There is also |
That fixed the delay on save. Thank you! Although the lag on startup still exists. |
lag on startup i cannot reproduce, but it might be related to you shell. if you |
I tried setting shell to Should I open a new issue for this? |
I also tried opening neovim from a fresh shell with all environment variables reset ( |
set the shell through nvim maybe ? I'm really not sure how this plugin could affect 10seconds of startup time, this has been discussed many times and it was never this fault. Been using this for a long time, when i started writing it and never experienced this. |
Yes, I that was the first thing I tried. I set
I will try that.
I've never debugged/profiled lua in nvim before. I'll look it up, but if you know any specific references it would be helpful.
My laptop has 4 cores with HT (8 threads) (specifically i5-8265U), 16GB RAM and SSDs (no HDDs). I don't think it's a hardware performance issue. Thank you for writing this plugin ❤️, I will try my best to debug this issue. |
I tried the
Looks like Another thing I noticed is that in a directory with
What's even more puzzling is that these two directories are branches of the same repo, checked out at different directories. I will try profiling this further, apologize for all the pings 🙇 Update: I have identified this line to be the cause of it: Update 2: I have further identified this to be the cause of it: Update 3: |
Aha! I found the issue. There were many, many untracked files - Is there a reason |
hi @Samyak2, you debugged perfectly, thanks a lot :) |
Yes, ignoring or deleting these files is a good solution. But, I was wondering if it's possible to disable all git operations in I have the following set in my config: vim.g.nvim_tree_git_hl = 0
vim.g.nvim_tree_gitignore = 0
vim.g.nvim_tree_show_icons = {
git = 0,
folders = 1,
files = 1,
} and no git information shows up in the tree. So, is that git information really needed? I can send a PR to fix this if it's not needed. |
i don't think so, if you can send a PR to fix it it'll be very welcome :) |
I stumbled in this today, you should definitely set git hl and git icons off by default. |
I'm not sure because I'm pretty sure most people use this. what i should do though is rewrite the git module because I can make it fast. |
Hi, thank you for your time and effort for writing and maintaining this great plugin 😄 I have basically the same issue (hanging on startup/buffer save/opening fugitive for >3s) when editing my dotfiles and figured out it relates to git as well: Just a use case to take into account if you happen to rewrite the git module? 🙃 |
#549 |
Uh oh!
There was an error while loading. Please reload this page.
After install nvim-tree nvim hangs on saving 🤔 somtime just 2sec, sometime more ...

any idea? whats info need for debug?
The text was updated successfully, but these errors were encountered: