/easyswitch.nvim

Primary LanguageLuaMIT LicenseMIT

easyswitch.nvim

This is a simple plugin to turn to add a functionality to turn on or off specific plugin without updating the neovim config

THIS IS WORK IN PROGRESS

📦 Installation

{ -- Lazy
    "azatakmyradov/easyswitch.nvim",
    dependencies = {
        "MunifTanjim/nui.nvim"
    },
},

⚙️ Configuration

!!!These can't be done in main init.lua file in lazy plugins folder. I recommend creating a easyswitch.lua file to store plugins that can be disabled.

Multiple plugins

You can wrap an object with new method from plugin:

return require('easyswitch').new({
    { 'github/copilot.vim', },
    { 'stevearc/conform.nvim', }
})

-- OR --

return require('easyswitch').new({
    'github/copilot.vim',
})

Single plugin

  1. Add cond option to lazy plugins that you want to control. Ex:
{
    -- GitHub Copilot
    'github/copilot.vim',
    cond = require("easyswitch").is_active("copilot.vim"),
}
  1. Then you can enable/disable that plugin using this command
:lua require('easyswitch').toggle()

✨ Keymaps

Normal mode:

  • E - to enable plugin
  • D - to disable plugin