Compare commits

..

No commits in common. "ca57edd1431740e013c951431667aa9f12ec8558" and "7c4dc26c9db62ba027b54c7aa49e7d91d528388b" have entirely different histories.

5 changed files with 15 additions and 22 deletions

View File

@ -1,3 +0,0 @@
snippet tp "{% partial ... " i
{% partial '$1'$0 %}
endsnippet

View File

@ -2,12 +2,6 @@ snippet todo "// TODO"
// TODO $0 // TODO $0
endsnippet endsnippet
snippet fn "function .."
function $1($2) {
$0
}
endsnippet
snippet if "if ( ... ) { ... }" snippet if "if ( ... ) { ... }"
if ($1) { if ($1) {
$0 $0

View File

@ -58,7 +58,7 @@ Plug '~/nvim-paper-tonic'
Plug 'hrsh7th/cmp-nvim-lsp', { 'branch': 'main' } Plug 'hrsh7th/cmp-nvim-lsp', { 'branch': 'main' }
Plug 'hrsh7th/cmp-buffer', { 'branch': 'main' } Plug 'hrsh7th/cmp-buffer', { 'branch': 'main' }
Plug 'hrsh7th/cmp-path', { 'branch': 'main' } Plug 'hrsh7th/cmp-path', { 'branch': 'main' }
" Plug 'uga-rosa/cmp-dictionary', { 'branch': 'main' } Plug 'uga-rosa/cmp-dictionary', { 'branch': 'main' }
let g:cmp_dictionary_exact = -1 let g:cmp_dictionary_exact = -1
Plug 'quangnguyen30192/cmp-nvim-ultisnips', { 'branch': 'main' } Plug 'quangnguyen30192/cmp-nvim-ultisnips', { 'branch': 'main' }

View File

@ -7,6 +7,7 @@ cmp.setup({
nvim_lsp = "[LSP]", nvim_lsp = "[LSP]",
path = "[Path]", path = "[Path]",
buffer = "[Buffer]", buffer = "[Buffer]",
dictionary = "[Dict]",
ultisnips = "[UltiSnips]", ultisnips = "[UltiSnips]",
})[entry.source.name] })[entry.source.name]
return vim_item return vim_item
@ -23,17 +24,12 @@ cmp.setup({
end, end,
}, },
mapping = { mapping = {
['<C-n>'] = cmp.mapping.complete(),
['<C-y>'] = cmp.mapping.confirm({ select = true }),
-- ['<C-e>'] = cmp.mapping.close(),
['<C-e>'] = cmp.mapping.abort(),
['<C-d>'] = cmp.mapping.scroll_docs(-4), ['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-u>'] = cmp.mapping.scroll_docs(4), ['<C-u>'] = 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 = { sources = {
{ {
@ -47,10 +43,16 @@ cmp.setup({
keyword_length = 4, keyword_length = 4,
max_item_count = 20, max_item_count = 20,
}, },
{
name = 'dictionary',
keyword_length = 4,
max_item_count = 20,
},
{ {
name = 'ultisnips', name = 'ultisnips',
priority_weight = 10, priority_weight = 10,
keyword_length = 1, keyword_length = 1,
}, },
...
} }
}) })

View File

@ -1,9 +1,9 @@
-- nvim-autopairs -- nvim-autopairs
require('nvim-autopairs').setup{} require('nvim-autopairs').setup{}
-- you need setup cmp first put this after cmp.setup() -- you need setup cmp first put this after cmp.setup()
require("cmp").setup({ require("nvim-autopairs.completion.cmp").setup({
map_cr = false, -- map <CR> on insert mode map_cr = true, -- map <CR> on insert mode
map_complete = false, -- it will auto insert `(` after select function or method item map_complete = true, -- it will auto insert `(` after select function or method item
auto_select = true -- automatically select the first item auto_select = true -- automatically select the first item
}) })