Skip to content

Commit a34e426

Browse files
docs: update readme (#13)
1 parent c1bad34 commit a34e426

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# bigfile.nvim
22

3-
This plugin disables certain features if the opened file is big.
3+
This plugin automatically disables certain features if the opened file is big.
44
File size and features to disable are configurable.
55

6-
Automatic 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`, `illuminate.vim` `NoMatchParen`, `syntax off`, ... (full list at the end)
77

8-
Integrations that may need manual configuration: `treesitter`.
98
You can also add your own features.
109

1110
# Setup
@@ -21,8 +20,11 @@ use {
2120

2221
The plugin ships with common default options. No further setup is required.
2322

23+
## Customization
24+
2425
```lua
25-
local default_config = {
26+
-- default config
27+
require("bigfile").config {
2628
filesize = 2, -- size of the file in MiB, the plugin round file sizes to the closest MiB
2729
pattern = { "*" }, -- autocmd pattern
2830
features = { -- features to disable
@@ -38,18 +40,16 @@ local default_config = {
3840
}
3941
```
4042

41-
Full description of features is at the end of this file.
42-
43-
## Customization
43+
Full description of the default features is at the end of this file.
4444

4545
You can override the default configuration, or add your own custom features
4646

4747
```lua
48-
-- all fields except `name` and `disable` can be nil
48+
-- all fields except `name` and `disable` are optional
4949
local mymatchparen = {
5050
name = "mymatchparen", -- name
5151
opts = {
52-
defer = false, -- true if `disable` should be called on `BufReadPost` and not `BufReadPre`
52+
defer = false, -- set to true if `disable` should be called on `BufReadPost` and not `BufReadPre`
5353
},
5454
disable = function() -- called to disable the feature
5555
vim.cmd "NoMatchParen"

lua/bigfile/features.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ feature("indent_blankline", {
6767
end,
6868
})
6969

70-
---@diagnostic disable: assign-type-mismatch
7170
feature("vimopts", {
7271
disable = function()
7372
vim.opt_local.swapfile = false
@@ -96,10 +95,10 @@ feature("filetype", {
9695
----@return feature
9796
function M.get_feature(raw_feature)
9897
local name
99-
if type(raw_feature) == "table" then -- builtin feature
98+
if type(raw_feature) == "table" then -- custom feature
10099
name = raw_feature.name
101100
feature(name, raw_feature)
102-
else
101+
else -- builtin feature
103102
name = raw_feature
104103
end
105104

lua/bigfile/init.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ function M.setup(overrides)
106106
callback = function(args)
107107
pre_bufread_callback(args.buf, config)
108108
end,
109-
desc = string.format("Performance rule for handling files over %sMiB", config.filesize),
109+
desc = string.format(
110+
"[bigfile.nvim] Performance rule for handling files over %sMiB",
111+
config.filesize
112+
),
110113
})
111114

112115
if vim.tbl_contains(config.features, "treesitter") then

0 commit comments

Comments
 (0)