From f55a3e7fe5eb0d2329a06c38e13a46513d459eaf Mon Sep 17 00:00:00 2001 From: Michael Jakl Date: Mon, 24 Apr 2023 06:55:44 +0200 Subject: [PATCH] Document cmd.ConfirmBehavior options (#1503) --- doc/cmp.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/cmp.txt b/doc/cmp.txt index d2c095c..e0d3118 100644 --- a/doc/cmp.txt +++ b/doc/cmp.txt @@ -218,6 +218,14 @@ NOTE: `lua require('cmp').complete()` can be used to call these functio If you didn't select any item and the option table contains `select = true`, nvim-cmp will automatically select the first item. + You can control, how the completion item is injected into + the file through the `behavior` option: + + `behavior=cmd.ConfirmBehavior.Insert`: inserts the selected item and + moves adjacent text to the right (default). + `bheavior=cmd.ConfirmBehavior.Replace`: replaces adjecent text with + the selected item. + *cmp.event:on* (%EVENT_NAME%, callback) Subscribe to nvim-cmp's event. Events are listed below.