Skip to content
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

File browsing too slow in large git repository #359

Open
gmmyung opened this issue Feb 11, 2024 · 1 comment
Open

File browsing too slow in large git repository #359

gmmyung opened this issue Feb 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gmmyung
Copy link

gmmyung commented Feb 11, 2024

Description

I am working on a directory with huge git submodules, many gigabytes worth of code. It takes 3 seconds to run git status.
It also takes 3 seconds to load the directory, and this delay disappears when git_status = false. Can it be fixed by lazy loading of git status? Fast file browsing is important, but I don't want to completely disable git integration.

Neovim version

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1703358377

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.5/share/nvim"

Run :checkhealth for more info

Operating system and version

macOS 14.3.1

Steps to reproduce

:Telescope file_browser

Expected behavior

File browser opens instantly.

Actual behavior

There is significant delay on opening the file browser.

Minimal config

// lazy.nvim config

return {
  'nvim-telescope/telescope.nvim',
  branch = '0.1.x',
  dependencies = {
    'nvim-lua/plenary.nvim',
    'nvim-treesitter/nvim-treesitter',
    'nvim-telescope/telescope-file-browser.nvim',
    'nvim-tree/nvim-web-devicons',
  },
  config = function()
    require('telescope').setup {
      extensions = {
	file_browser = {
	  hijack_netrw = true,
	}
      }
    }
    require('telescope').load_extension 'file_browser'
  end,
  keys = {
    { '<Leader>d', '<cmd>Telescope file_browser<cr>', mode = 'n', desc = 'Telescope file browser' },
    { '<Leader>b', '<cmd>Telescope buffers<cr>', mode = 'n', desc = 'Telescope buffers' },
    { '<Leader>ff', '<cmd>Telescope find_files<cr>', mode = 'n', desc = 'Telescope find file'},
  }
}
@gmmyung gmmyung added the bug Something isn't working label Feb 11, 2024
@jamestrew
Copy link
Collaborator

This is an interesting idea.
Unfortunately, I don't think telescope has a mechanism for doing such a thing at the moment.
But I'll keep this in mind for future telescope enhancements and keep this issue open.
There might be some workaround for it in the meantime I can explore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants