Skip to content

Instantly share code, notes, and snippets.

@hrsh7th
Created September 24, 2022 03:56
Show Gist options
  • Save hrsh7th/e327907d57756d54f22f80d0fd03ef64 to your computer and use it in GitHub Desktop.
Save hrsh7th/e327907d57756d54f22f80d0fd03ef64 to your computer and use it in GitHub Desktop.
cmp-toggle example
local cmp = require('cmp')
vim.api.nvim_create_user_command('CmpToggle', function()
local config = cmp.get_config()
if config.enabled == false then
cmp.setup { enabled = require('cmp.config.default')().enabled }
else
cmp.setup { enabled = false }
end
end, {})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment