From ae708ef3a44dfb0cb42d1aa901b4c57c2de53aa3 Mon Sep 17 00:00:00 2001 From: 0x74696d6d79 <34635512+tzx@users.noreply.github.com> Date: Sun, 26 Dec 2021 00:57:15 -0500 Subject: [PATCH] Change cmp#ready to CmpReady and document autocmds better (#669) --- doc/cmp.txt | 7 +++++-- plugin/cmp.lua | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/cmp.txt b/doc/cmp.txt index 166287e..d71b866 100644 --- a/doc/cmp.txt +++ b/doc/cmp.txt @@ -325,8 +325,11 @@ Highlight *cmp-highlight* ============================================================================== Autocmd *cmp-autocmd* -*cmp#ready* - Invoke after sourcing the `plugin/cmp.lua` +You can create custom autocommands for certain nvim-cmp events by defining +autocommands for the User event with the following patterns. + +*CmpReady* + Invoked when nvim-cmp gets sourced from `plugin/cmp.lua`. diff --git a/plugin/cmp.lua b/plugin/cmp.lua index 71b9014..ae4d4f6 100644 --- a/plugin/cmp.lua +++ b/plugin/cmp.lua @@ -126,7 +126,7 @@ end vim.cmd [[command! CmpStatus lua require('cmp').status()]] -vim.cmd [[doautocmd User cmp#ready]] +vim.cmd [[doautocmd User CmpReady]] if vim.on_key then vim.on_key(function(keys)