Compare commits
2 Commits
7c4dc26c9d
...
ca57edd143
Author | SHA1 | Date |
---|---|---|
Ray Elliott | ca57edd143 | |
Ray Elliott | 2df15c3410 |
|
@ -0,0 +1,3 @@
|
|||
snippet tp "{% partial ... " i
|
||||
{% partial '$1'$0 %}
|
||||
endsnippet
|
|
@ -2,6 +2,12 @@ snippet todo "// TODO"
|
|||
// TODO $0
|
||||
endsnippet
|
||||
|
||||
snippet fn "function .."
|
||||
function $1($2) {
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet if "if ( ... ) { ... }"
|
||||
if ($1) {
|
||||
$0
|
||||
|
|
|
@ -58,7 +58,7 @@ Plug '~/nvim-paper-tonic'
|
|||
Plug 'hrsh7th/cmp-nvim-lsp', { 'branch': 'main' }
|
||||
Plug 'hrsh7th/cmp-buffer', { '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
|
||||
Plug 'quangnguyen30192/cmp-nvim-ultisnips', { 'branch': 'main' }
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ cmp.setup({
|
|||
nvim_lsp = "[LSP]",
|
||||
path = "[Path]",
|
||||
buffer = "[Buffer]",
|
||||
dictionary = "[Dict]",
|
||||
ultisnips = "[UltiSnips]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
|
@ -24,12 +23,17 @@ cmp.setup({
|
|||
end,
|
||||
},
|
||||
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-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 = {
|
||||
{
|
||||
|
@ -43,16 +47,10 @@ cmp.setup({
|
|||
keyword_length = 4,
|
||||
max_item_count = 20,
|
||||
},
|
||||
{
|
||||
name = 'dictionary',
|
||||
keyword_length = 4,
|
||||
max_item_count = 20,
|
||||
},
|
||||
{
|
||||
name = 'ultisnips',
|
||||
priority_weight = 10,
|
||||
keyword_length = 1,
|
||||
},
|
||||
...
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
-- nvim-autopairs
|
||||
require('nvim-autopairs').setup{}
|
||||
-- you need setup cmp first put this after cmp.setup()
|
||||
require("nvim-autopairs.completion.cmp").setup({
|
||||
map_cr = true, -- map <CR> on insert mode
|
||||
map_complete = true, -- it will auto insert `(` after select function or method item
|
||||
require("cmp").setup({
|
||||
map_cr = false, -- map <CR> on insert mode
|
||||
map_complete = false, -- it will auto insert `(` after select function or method item
|
||||
auto_select = true -- automatically select the first item
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue