From 33e7ee676b2d8fab57ebf305f7bad396e7e41879 Mon Sep 17 00:00:00 2001 From: Christian Nieves Date: Mon, 25 Nov 2024 19:55:55 +0000 Subject: [PATCH 1/2] Support disabling nvim-cmp --- README.md | 35 +++++++++++++++++++++++------------ lua/bigfile/features.lua | 8 ++++++++ 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index f76c05b..49f149c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ This plugin automatically disables certain features if the opened file is big. File size and features to disable are configurable. -Features/integrations include: `LSP`, `treesitter`, `indent_blankline`, `illuminate.vim` `NoMatchParen`, `syntax off`, ... (full list at the end) +Features/integrations include: `LSP`, `treesitter`, `indent_blankline`, +`illuminate.vim` `NoMatchParen`, `syntax off`, ... (full list at the end) You can also add your own features. @@ -30,6 +31,7 @@ require("bigfile").setup { features = { -- features to disable "indent_blankline", "illuminate", + "cmp", "lsp", "treesitter", "syntax", @@ -87,17 +89,26 @@ require("bigfile").setup { # Caveats -- `matchparen` stays disabled, even after you close the big file, you can call `:DoMatchParen` manually to enable it +- `matchparen` stays disabled, even after you close the big file, you can call + `:DoMatchParen` manually to enable it # Features/integrations -| name | function | -| ------------------ | ----------------------------------------------------------------------------------------------------------- | -| `lsp` | detaches the lsp client from buffer | -| `treesitter` | disables treesitter for the buffer | -| `illuminate` | disables `RRethy/vim-illuminate` for the buffer | -| `indent_blankline` | disables `lukas-reineke/indent-blankline.nvim` for the buffer | -| `syntax` | `:syntax off` for the buffer | -| `filetype` | `filetype = ""` for the buffer | -| `vimopts` | `swapfile = false` `foldmethod = "manual"` `undolevels = -1` `undoreload = 0` `list = false` for the buffer | -| `matchparen` | `:NoMatchParen` globally, currently this feature will stay disabled, even after you close the big file | +| name | function | +| ------------------ | ------------------------------------- | +| `lsp` | detaches the lsp client from buffer | +| `treesitter` | disables treesitter for the buffer | +| `illuminate` | disables `RRethy/vim-illuminate` for | +: : the buffer : +| `indent_blankline` | disables | +: : `lukas-reineke/indent-blankline.nvim` : +: : for the buffer : +| `syntax` | `:syntax off` for the buffer | +| `filetype` | `filetype = ""` for the buffer | +| `vimopts` | `swapfile = false` `foldmethod = | +: : "manual"` `undolevels = -1` : +: : `undoreload = 0` `list = false` for : +: : the buffer : +| `matchparen` | `:NoMatchParen` globally, currently | +: : this feature will stay disabled, even : +: : after you close the big file : diff --git a/lua/bigfile/features.lua b/lua/bigfile/features.lua index 3f12bb5..964dc05 100644 --- a/lua/bigfile/features.lua +++ b/lua/bigfile/features.lua @@ -88,6 +88,14 @@ feature("illuminate", { end, }) +feature("cmp", { + disable = function() + pcall(function() + require("cmp").setup.buffer({ enabled = false}) + end) + end, +}) + feature("indent_blankline", { disable = function(_) pcall(function() From 90f5d239ae93e633125e055de934299f9c41e127 Mon Sep 17 00:00:00 2001 From: Christian Nieves Date: Mon, 25 Nov 2024 20:05:12 +0000 Subject: [PATCH 2/2] Undo readme formatting --- README.md | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 49f149c..e43c6e7 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ This plugin automatically disables certain features if the opened file is big. File size and features to disable are configurable. -Features/integrations include: `LSP`, `treesitter`, `indent_blankline`, -`illuminate.vim` `NoMatchParen`, `syntax off`, ... (full list at the end) +Features/integrations include: `LSP`, `treesitter`, `indent_blankline`, `illuminate.vim` `NoMatchParen`, `syntax off`, ... (full list at the end) You can also add your own features. @@ -89,26 +88,17 @@ require("bigfile").setup { # Caveats -- `matchparen` stays disabled, even after you close the big file, you can call - `:DoMatchParen` manually to enable it +- `matchparen` stays disabled, even after you close the big file, you can call `:DoMatchParen` manually to enable it # Features/integrations -| name | function | -| ------------------ | ------------------------------------- | -| `lsp` | detaches the lsp client from buffer | -| `treesitter` | disables treesitter for the buffer | -| `illuminate` | disables `RRethy/vim-illuminate` for | -: : the buffer : -| `indent_blankline` | disables | -: : `lukas-reineke/indent-blankline.nvim` : -: : for the buffer : -| `syntax` | `:syntax off` for the buffer | -| `filetype` | `filetype = ""` for the buffer | -| `vimopts` | `swapfile = false` `foldmethod = | -: : "manual"` `undolevels = -1` : -: : `undoreload = 0` `list = false` for : -: : the buffer : -| `matchparen` | `:NoMatchParen` globally, currently | -: : this feature will stay disabled, even : -: : after you close the big file : +| name | function | +| ------------------ | ----------------------------------------------------------------------------------------------------------- | +| `lsp` | detaches the lsp client from buffer | +| `treesitter` | disables treesitter for the buffer | +| `illuminate` | disables `RRethy/vim-illuminate` for the buffer | +| `indent_blankline` | disables `lukas-reineke/indent-blankline.nvim` for the buffer | +| `syntax` | `:syntax off` for the buffer | +| `filetype` | `filetype = ""` for the buffer | +| `vimopts` | `swapfile = false` `foldmethod = "manual"` `undolevels = -1` `undoreload = 0` `list = false` for the buffer | +| `matchparen` | `:NoMatchParen` globally, currently this feature will stay disabled, even after you close the big file |