Skip to content

Commit 33e7ee6

Browse files
committed
Support disabling nvim-cmp
1 parent 33eb067 commit 33e7ee6

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed

README.md

+23-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
This plugin automatically disables certain features if the opened file is big.
44
File size and features to disable are configurable.
55

6-
Features/integrations include: `LSP`, `treesitter`, `indent_blankline`, `illuminate.vim` `NoMatchParen`, `syntax off`, ... (full list at the end)
6+
Features/integrations include: `LSP`, `treesitter`, `indent_blankline`,
7+
`illuminate.vim` `NoMatchParen`, `syntax off`, ... (full list at the end)
78

89
You can also add your own features.
910

@@ -30,6 +31,7 @@ require("bigfile").setup {
3031
features = { -- features to disable
3132
"indent_blankline",
3233
"illuminate",
34+
"cmp",
3335
"lsp",
3436
"treesitter",
3537
"syntax",
@@ -87,17 +89,26 @@ require("bigfile").setup {
8789

8890
# Caveats
8991

90-
- `matchparen` stays disabled, even after you close the big file, you can call `:DoMatchParen` manually to enable it
92+
- `matchparen` stays disabled, even after you close the big file, you can call
93+
`:DoMatchParen` manually to enable it
9194

9295
# Features/integrations
9396

94-
| name | function |
95-
| ------------------ | ----------------------------------------------------------------------------------------------------------- |
96-
| `lsp` | detaches the lsp client from buffer |
97-
| `treesitter` | disables treesitter for the buffer |
98-
| `illuminate` | disables `RRethy/vim-illuminate` for the buffer |
99-
| `indent_blankline` | disables `lukas-reineke/indent-blankline.nvim` for the buffer |
100-
| `syntax` | `:syntax off` for the buffer |
101-
| `filetype` | `filetype = ""` for the buffer |
102-
| `vimopts` | `swapfile = false` `foldmethod = "manual"` `undolevels = -1` `undoreload = 0` `list = false` for the buffer |
103-
| `matchparen` | `:NoMatchParen` globally, currently this feature will stay disabled, even after you close the big file |
97+
| name | function |
98+
| ------------------ | ------------------------------------- |
99+
| `lsp` | detaches the lsp client from buffer |
100+
| `treesitter` | disables treesitter for the buffer |
101+
| `illuminate` | disables `RRethy/vim-illuminate` for |
102+
: : the buffer :
103+
| `indent_blankline` | disables |
104+
: : `lukas-reineke/indent-blankline.nvim` :
105+
: : for the buffer :
106+
| `syntax` | `:syntax off` for the buffer |
107+
| `filetype` | `filetype = ""` for the buffer |
108+
| `vimopts` | `swapfile = false` `foldmethod = |
109+
: : "manual"` `undolevels = -1` :
110+
: : `undoreload = 0` `list = false` for :
111+
: : the buffer :
112+
| `matchparen` | `:NoMatchParen` globally, currently |
113+
: : this feature will stay disabled, even :
114+
: : after you close the big file :

lua/bigfile/features.lua

+8
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ feature("illuminate", {
8888
end,
8989
})
9090

91+
feature("cmp", {
92+
disable = function()
93+
pcall(function()
94+
require("cmp").setup.buffer({ enabled = false})
95+
end)
96+
end,
97+
})
98+
9199
feature("indent_blankline", {
92100
disable = function(_)
93101
pcall(function()

0 commit comments

Comments
 (0)