nvim-colorizer.lua icon indicating copy to clipboard operation
nvim-colorizer.lua copied to clipboard

Migrate commands definition inside setup()

Open antonk52 opened this issue 1 year ago • 0 comments

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,
}

antonk52 avatar Jun 29 '24 00:06 antonk52