Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added init.lua #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added init.lua #147

wants to merge 1 commit into from

Conversation

Muizzyranking
Copy link

Adding this file would allow users call setup require("rainbow-delimiters").setup() instead of
require("rainbow-delimiters.setup").setup() as the first is what I've seen many plugins authors do

Another reason is so lazy.nvim users can use opts instead of config which i think is recommended by lazy.nvim

Adding this file would allow users call setup
`require("rainbow-delimiters").setup()` instead of `
require("rainbow-delimiters.setup").setup()` as the first is what I've
seen many plugins authors do

Another reason is so lazy.nvim users can use opts instead of config
which i think is recommended by lazy.nvim

Signed-off-by: Muizzyranking <[email protected]>
@Muizzyranking
Copy link
Author

this is an example.

return {
  "HiPhish/rainbow-delimiters.nvim",
  event = "BufRead",
  opts = {
    enable_when = function(bufnr)
      local max_filesize = 1 * 1024 * 1024 -- 1 MB
      local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(bufnr))
      if ok and stats and stats.size > max_filesize then
        return nil
      end
    end,
  },
  -- config = function()
  --   require("rainbow-delimiters.setup").setup({
  --     enable_when = function(bufnr)
  --       local max_filesize = 1 * 1024 * 1024 -- 1 MB
  --       local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(bufnr))
  --       if ok and stats and stats.size > max_filesize then
  --         return nil
  --       end
  --     end,
  --   })
  -- end,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant