Skip to content

Commit 67a03ff

Browse files
feat: use setup for configuration (#15)
1 parent 7bf45d6 commit 67a03ff

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The plugin ships with common default options. No further setup is required.
2424

2525
```lua
2626
-- default config
27-
require("bigfile").config {
27+
require("bigfile").setup {
2828
filesize = 2, -- size of the file in MiB, the plugin round file sizes to the closest MiB
2929
pattern = { "*" }, -- autocmd pattern
3030
features = { -- features to disable
@@ -56,7 +56,7 @@ local mymatchparen = {
5656
end,
5757
}
5858

59-
require("bigfile").config {
59+
require("bigfile").setup {
6060
filesize = 1,
6161
features = { "treesitter", mymatchparen }
6262
}

lua/bigfile/init.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ local function pre_bufread_callback(bufnr, rule)
7373
})
7474
end
7575

76-
---@param overrides config|nil
77-
function M.config(overrides)
78-
default_config = vim.tbl_deep_extend("force", default_config, overrides or {})
79-
end
80-
8176
---@param overrides config|nil
8277
function M.setup(overrides)
8378
local config = vim.tbl_deep_extend("force", default_config, overrides or {})
@@ -95,6 +90,10 @@ function M.setup(overrides)
9590
config.filesize
9691
),
9792
})
93+
94+
vim.g.loaded_bigfile_plugin = true
9895
end
9996

97+
M.config = M.setup
98+
10099
return M

0 commit comments

Comments
 (0)