Compare commits

..

2 Commits

Author SHA1 Message Date
Ray Elliott ca57edd143 update config for updated plugins 2021-12-13 15:16:24 +00:00
Ray Elliott 2df15c3410 update version number 2021-12-12 19:02:16 +00:00
5 changed files with 22 additions and 15 deletions

View File

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

View File

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

View File

@ -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' }

View File

@ -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,
},
...
}
})

View File

@ -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
})