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

Migrate commands definition inside setup() #83

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

Conversation

antonk52
Copy link

@antonk52 antonk52 commented Jun 29, 2024

With modern package managers disabling built in commands is awkward and undocumented. This PR moves the definition of colorizer commands into the setup function.

Example of disabling builtin commands currently

-- lazy.nvim
require({
  {
    'NvChad/nvim-colorizer.lua',
    init = function()
      vim.g.loaded_colorizer = 1
    end,
    opts = {}
  }
})

-- packer
use {
  'NvChad/nvim-colorizer.lua',
  setup = function()
    require('colorizer').setup()
  end,
  config = function()
    vim.g.loaded_colorizer = 1
  end,
}

With this PR disabling builtin commands can be done as easy as

-- lazy.nvim
require({
  {
    'NvChad/nvim-colorizer.lua',
    opts = {
      default_commands = false
    }
  }
})

-- packer
use {
  'NvChad/nvim-colorizer.lua',
  setup = function()
    require('colorizer').setup({
      default_commands = false
    })
  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