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

Is this repo still alive? #28

Open
rodhash opened this issue Nov 30, 2024 · 1 comment
Open

Is this repo still alive? #28

rodhash opened this issue Nov 30, 2024 · 1 comment

Comments

@rodhash
Copy link

rodhash commented Nov 30, 2024

Not sure if this repo is still maintained but I'll drop my issue here.

Having a 10MB json file my Nvim takes forever to load it (I can't attach the json, too many sensitive data).

Tried this plugin but no luck so far.

3 things I tried:

  • Added BufReadPre so it load before
  • Tried with higher priority too
  • Tweaked pattern to verify the first 2 lines of the file

And of course I tried the default config too but still nothing, I can't open this big json unless I use --clean which removes every plugin.

My config:

  {
    "LunarVim/bigfile.nvim",
    event = "BufReadPre",
    opts = {
      filesize = 1,
      pattern = function(bufnr, filesize_mib)

        local first_line = vim.fn.strwidth(vim.fn.getline(1))
        local second_line = vim.fn.strwidth(vim.fn.getline(2))

        -- you can't use `nvim_buf_line_count` because this runs on BufReadPre
        local file_contents = vim.fn.readfile(vim.api.nvim_buf_get_name(bufnr))
        local file_length = #file_contents
        local filetype = vim.filetype.match({ buf = bufnr })
        if file_length > 5000 or first_line > 300 or second_line > 300 then
          return true
        end
      end
    },
    config = function (_, opts)
      require("bigfile").setup(opts)
    end
  },

Thanks

@rodhash
Copy link
Author

rodhash commented Nov 30, 2024

Managed to identify a few plugins that if enabled heavily impacts opening big files such as a 10MB json file.

It seems that not all plugins / configs are being disabled by bigfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant