Git Product home page Git Product logo

bigfile.nvim's Introduction

bigfile.nvim's People

Contributors

kylo252 avatar lostneophyte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bigfile.nvim's Issues

Treesitter dependency

local treesitter_configs = require "nvim-treesitter.configs"
treesitter_configs.setup {
highlight = {
disable = function(_, buf)
return pcall(vim.api.nvim_buf_get_var, buf, "bigfile_detected")
end,
},
}

is this intentional? this plugin requires treesitter cause of it

Detected files are opened without any content when open from whole directory

When the detected file is opened in a nvim-tree, it always shows with empty content.
But if I nvim XXX.xml directly, it works as expectation.

I have tried to disable nvim-tree, nvim-tree probably is not the issue.

This is the view of opening single file by nvim XXX.xml (though file in pic below is .osm, it is viewed as xml, and other xml files cannot be opened correctly as well)
Screenshot 2023-12-18 at 17 07 24
and this is the view of opening from directory by nvim . and called by nvim-tree
Screenshot 2023-12-18 at 17 08 17

This is my mininal config, probably same as default.

require("bigfile").setup {
  filesize = 2,

  pattern = { * },

  features = {
    "indent_blankline",
    "illuminate",
    "lsp",
    "treesitter",
    "syntax",
    "matchparen",
    "vimopts",
    "filetype",
  },
}

Tks for viewing, this plug-in is really useful and necessary for a data-sci developer ;)

Disable based on number of lines

Will it be possible to add option to disable features (enable this plugin) based on number of lines?

For example, a python file with 5k lines of code will be hardly 200Kb in size yet insanely slow.

Disable mini.indentscope

mini.indentscope is a plugin that shows the current indentation scope (i.e. it highlights the current indent guide).

This plugin is enabled by default in LazyVim and it seems to cause performance issues on large files, from my experience.

Notify user on what features are disabled

Hi. This is a feature request, not a bug.

I recently run into a weird issue with tsserver LSP not working properly in big files. It turned out this plugin forcibly detaches buffers without stopping servers.

I request to make this plugin to be verbose and explicit on which features are disabled, so users can see its actions reported. This may be configurable via silent = false config.

E.g. of a code snippet that can do reporting:

vim.notify("bigfile.nvim: buffer: LSP servers s are forcibly detached!", vim.log.levels.WARN)

This will make it easier to troubleshoot neovim. Thanks.

If plugin is silent, it's hard to troubleshoot it

Here is an example.

I got an typescript tsserver Error: No Project. error that misguided me on the source of the issue. The log says nothing that it has lost connection (buffer got detached) further confusing me. Because of that I run into a wrong issue.

FILE: tsserver.log
Info 0    [12:09:24.718] Starting TS Server
Info 1    [12:09:24.719] Version: 5.2.2
Info 2    [12:09:24.719] Arguments: /home/alex/dotfiles/nvm/.nvm/versions/node/v20.5.0/bin/node ./TypeScript/node_modules/typescript/lib/tsserver.js --serverMode partialSemantic --useInferredProjectPerProjectRoot --disableAutomaticTypingAcquisition --cancellationPipeName /tmp/6eb47b130a698bb88d59be24690b11c3/tscancellation* --logVerbosity normal --logFile /tmp/tsserver/tsserver-log-as5oK1/tsserver.log --locale en --validateDefaultNpmLocation --useNodeIpc
Info 3    [12:09:24.719] Platform: linux NodeVersion: v20.5.0 CaseSensitive: true
Info 4    [12:09:24.719] ServerMode: 1 hasUnknownServerMode: undefined
Info 5    [12:09:24.727] Host information neovim
Info 6    [12:09:24.727] Format host information updated
Info 7    [12:09:26.114] Starting updateGraphWorker: Project: /dev/null/inferredProject1*
Info 8    [12:09:27.359] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* Version: 1 structureChanged: true structureIsReused:: Not Elapsed: 1244.2914890013635ms
Info 9    [12:09:27.359] Project '/dev/null/inferredProject1*' (Inferred)
Info 10   [12:09:27.359] 	Files (8)

...
Info 18   [12:09:28.150] -----------------------------------------------
Info 18   [12:09:28.150] Open files: 
Info 18   [12:09:28.150] After ensureProjectForOpenFiles:
Info 19   [12:09:28.150] Project '/dev/null/inferredProject1*' (Inferred)
Info 19   [12:09:28.150] 	Files (0)

Info 19   [12:09:28.150] -----------------------------------------------
Info 19   [12:09:28.150] Open files: 
Err 19    [12:09:28.165] Exception on executing command {
  "seq": 4,
  "type": "request",
  "command": "navtree",
  "arguments": {
    "file": "./TypeScript/src/compiler/checker.ts"
  }
}:

    No Project.

    Error: No Project.
        at Object.ThrowNoProject (./TypeScript/node_modules/typescript/lib/tsserver.js:174959:11)
        at ScriptInfo.getDefaultProject (./TypeScript/node_modules/typescript/lib/tsserver.js:175711:23)
        at _ProjectService.doEnsureDefaultProjectForFile (./TypeScript/node_modules/typescript/lib/tsserver.js:178932:36)
        at _ProjectService.ensureDefaultProjectForFile (./TypeScript/node_modules/typescript/lib/tsserver.js:178927:75)
        at IpcIOSession.getFileAndProjectWorker (./TypeScript/node_modules/typescript/lib/tsserver.js:183899:77)
        at IpcIOSession.getFileAndProject (./TypeScript/node_modules/typescript/lib/tsserver.js:183885:17)
        at IpcIOSession.getFileAndLanguageServiceForSyntacticOperation (./TypeScript/node_modules/typescript/lib/tsserver.js:183888:36)
        at IpcIOSession.getNavigationTree (./TypeScript/node_modules/typescript/lib/tsserver.js:184320:44)
        at navtree (./TypeScript/node_modules/typescript/lib/tsserver.js:182604:43)
        at ./TypeScript/node_modules/typescript/lib/tsserver.js:184838:69
        at IpcIOSession.executeWithRequestId (./TypeScript/node_modules/typescript/lib/tsserver.js:184830:14)
        at IpcIOSession.executeCommand (./TypeScript/node_modules/typescript/lib/tsserver.js:184838:29)
        at IpcIOSession.onMessage (./TypeScript/node_modules/typescript/lib/tsserver.js:184880:51)
        at process.<anonymous> (./TypeScript/node_modules/typescript/lib/tsserver.js:186461:14)
        at process.emit (node:events:514:28)
        at emit (node:internal/child_process:951:14)
        at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

It's easy to reproduce this behavior on any big file where LSP is attached. E.g.:

# run in shell
pushd $(mktemp -d)
git clone --no-tags --depth 1 [email protected]:microsoft/TypeScript.git
pushd TypeScript
rm /tmp/tsserver/tsserver-log-*/*.log
nvim compiler/checker.ts # 50k+ LOC 

Support disabling same features for the preview window of telescope

This plugin is useful for editing files.

But the preview window of telescope in nvim is often to use, and if the first file in the oldfiles list is just a big file, it will get blocked.
So I hope the same features can also be disabled in the telescope preview.

I don't know if it is easy to implement, I just think this is very useful then post this issue.

Thank you!

More flexible pattern and features combination?

This plugin works very well for frequently accessed large files.

Whether it could support disabling different features for different patterns? For example, I wanna disable treesitter but keep lsp enabled when I edit a C code file with over 10,000 lines. But for a file with more than 100,000 lines, it is more suitable to disable all features.

I'm not sure if this feature would complicate this plugin.

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.