Add local cmp = require('cmp') (#25)

This commit is contained in:
stvhuang
2021-08-15 23:28:31 +08:00
committed by GitHub
parent 8e5f09de1f
commit 03b0558334

View File

@@ -26,7 +26,8 @@ Then setup configuration.
```viml ```viml
" Setup global configuration. More on configuration below. " Setup global configuration. More on configuration below.
lua <<EOF lua <<EOF
require'cmp'.setup { local cmp = require('cmp')
cmp.setup {
-- You should change this example to your chosen snippet engine. -- You should change this example to your chosen snippet engine.
snippet = { snippet = {
expand = function(args) expand = function(args)
@@ -48,7 +49,7 @@ lua <<EOF
select = true, select = true,
}) })
}, },
-- You should specify your *installed* sources. -- You should specify your *installed* sources.
sources = { sources = {
{ name = 'buffer' } { name = 'buffer' }
@@ -119,7 +120,7 @@ The `cmp.mapping` helper has the below functions.
Which events should trigger `autocompletion`. Which events should trigger `autocompletion`.
If you leave this empty or `nil`, `nvim-cmp` does not perform completion automatically. If you leave this empty or `nil`, `nvim-cmp` does not perform completion automatically.
You can still use manual completion though (like omni-completion). You can still use manual completion though (like omni-completion).
Default: `{types.cmp.TriggerEvent.InsertEnter, types.cmp.TriggerEvent.TextChanged}` Default: `{types.cmp.TriggerEvent.InsertEnter, types.cmp.TriggerEvent.TextChanged}`
@@ -163,7 +164,7 @@ to return something other than `nil` takes precedence.
Each function must return `boolean|nil`. Each function must return `boolean|nil`.
Default: Default:
```lua ```lua
{ {
compare.offset, compare.offset,