dev (#1)
* dev * Improve sync design * Support buffer local mapping * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * stylua * tmp * tmp * tmp * tmp * tmp * tmp * tmp * integration * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * update * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp
This commit is contained in:
38
plugin/cmp.lua
Normal file
38
plugin/cmp.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
if vim.g.loaded_cmp then
|
||||
return
|
||||
end
|
||||
vim.g.loaded_cmp = true
|
||||
|
||||
local cmp = require'cmp'
|
||||
local misc = require'cmp.utils.misc'
|
||||
|
||||
-- TODO: https://github.com/neovim/neovim/pull/14661
|
||||
vim.cmd [[
|
||||
augroup cmp
|
||||
autocmd!
|
||||
autocmd InsertEnter * lua require'cmp.autocmd'.emit('InsertEnter')
|
||||
autocmd InsertLeave * lua require'cmp.autocmd'.emit('InsertLeave')
|
||||
autocmd TextChangedI,TextChangedP * lua require'cmp.autocmd'.emit('TextChanged')
|
||||
autocmd CompleteChanged * lua require'cmp.autocmd'.emit('CompleteChanged')
|
||||
autocmd CompleteDone * lua require'cmp.autocmd'.emit('CompleteDone')
|
||||
augroup END
|
||||
]]
|
||||
|
||||
if vim.fn.hlexists('CmpDocumentation') == 0 then
|
||||
vim.cmd [[highlight link CmpDocumentation NormalFloat]]
|
||||
end
|
||||
|
||||
if vim.fn.hlexists('CmpDocumentationBorder') == 0 then
|
||||
vim.cmd [[highlight link CmpDocumentationBorder NormalFloat]]
|
||||
end
|
||||
|
||||
misc.set(_G, { 'cmp', 'complete' }, function()
|
||||
cmp.complete()
|
||||
return vim.api.nvim_replace_termcodes('<Ignore>', true, true, true)
|
||||
end)
|
||||
|
||||
misc.set(_G, { 'cmp', 'close' }, function()
|
||||
cmp.close()
|
||||
return vim.api.nvim_replace_termcodes('<Ignore>', true, true, true)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user