bigfile.nvim
bigfile.nvim copied to clipboard
feat: add custom autocmd for user defined features
I want to disable features other than defined in this plugin. I added custom autocmd named BigfileBufReadPost to use such as below.
vim.api.nvim_create_autocmd("User", {
pattern = "BigfileBufReadPost",
callback = function(args)
vim.api.nvim_buf_call(args.buf, function()
-- disable heavy plugin such as https://github.com/lewis6991/satellite.nvim
vim.cmd.SatelliteDisable()
end)
end,
})
If you like to merge, I will add doc for this.
Nice feature. Please merge.
Sorry for the delay, I must have marked the notification as read
this is already possible but I though of a different way of doing it when creating the plugin. here's a modified example from the readme
-- all fields except `name` and `disable` are optional
local satellite = {
name = "satellite", -- name
opts = {
defer = true, -- set to true if `disable` should be called on `BufReadPost` and not `BufReadPre`
},
disable = function() -- called to disable the feature
vim.cmd.SatelliteDisable()
end,
}
require("bigfile").setup {
filesize = 1,
features = { "treesitter", satellite }
}
@LostNeophyte I would rather name the disable = like run or apply. Just to avoid confusion.
@LostNeophyte I would rather name the
disable =likerunorapply. Just to avoid confusion.
yea, it's a relic of the past. the plugin used to enable all the features back after the big buffers were closed, but the functionality was removed. so i removed the enable function and disable stayed.
I'm busy with school, but if you make a backwards compatible pr with a deprecation warning that says to use apply instead of disable i'll be happy to merge it
That's going to be a major change.... You don't seem use any versioning at all in this project. I would urge you to look at my nvim plugins to see how development is managed. What school btw?
That's going to be a major change.... You don't seem use any versioning at all in this project. I would urge you to look at my nvim plugins to see how development is managed
I didn't really find versioning necessary, I don't think anyone would set the version of this plugin in their plugin manager.
this is a small plugin so i'd just handle this in the feature constructor and vim.notify that disable needs to be changed and that support for it will be dropped in the future and mark the future commit as a breaking change. But maybe I'm missing something else that's useful about having versions?
What school btw?
last year of vocational school before studies