clean up legacy files
This commit is contained in:
parent
638ff2812f
commit
bc35923fe2
658 changed files with 196 additions and 1 deletions
49
legacy/lua/init-cmp.lua
Normal file
49
legacy/lua/init-cmp.lua
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
local cmp = require 'cmp'
|
||||
|
||||
cmp.setup({
|
||||
window = {documentation = cmp.config.window.bordered({border = "single"})},
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
-- set a name for each source
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
path = "[Path]",
|
||||
buffer = "[Buffer]",
|
||||
ultisnips = "[UltiSnips]"
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end
|
||||
},
|
||||
completion = {
|
||||
keyword_length = 1,
|
||||
max_item_count = 20
|
||||
-- autocomplete = false
|
||||
},
|
||||
snippet = {expand = function(args) vim.fn["UltiSnips#Anon"](args.body) end},
|
||||
mapping = {
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||
["<C-n>"] = cmp.mapping({
|
||||
i = function()
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item({behavior = cmp.SelectBehavior.Insert})
|
||||
else
|
||||
cmp.complete()
|
||||
end
|
||||
end
|
||||
})
|
||||
},
|
||||
sources = {
|
||||
{name = 'nvim_lsp', max_item_count = 8, keyword_length = 3},
|
||||
{name = 'path'},
|
||||
{name = 'buffer',
|
||||
option = {
|
||||
keyword_length = 4,
|
||||
max_item_count = 20,
|
||||
get_bufnrs = function()
|
||||
return vim.api.nvim_list_bufs()
|
||||
end
|
||||
}},
|
||||
{name = 'ultisnips', priority_weight = 10, keyword_length = 1}
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue