|
@@ -160,6 +160,7 @@ require('treesj').setup({
|
|
|
|
|
|
-- completion
|
|
-- completion
|
|
local cmp = require('cmp')
|
|
local cmp = require('cmp')
|
|
|
|
+local cmp_types = require('cmp.types')
|
|
cmp.setup({
|
|
cmp.setup({
|
|
snippet = {
|
|
snippet = {
|
|
expand = function(args)
|
|
expand = function(args)
|
|
@@ -174,12 +175,29 @@ cmp.setup({
|
|
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
}),
|
|
}),
|
|
sources = cmp.config.sources({
|
|
sources = cmp.config.sources({
|
|
- { name = "nvim_lsp" },
|
|
|
|
|
|
+ {
|
|
|
|
+ name = "nvim_lsp",
|
|
|
|
+ entry_filter = function(entry, ctx)
|
|
|
|
+ -- don't autocomplete keywords
|
|
|
|
+ return cmp_types.lsp.CompletionItemKind[entry:get_kind()] ~= 'Keyword'
|
|
|
|
+ end
|
|
|
|
+ },
|
|
{ name = "vsnip" },
|
|
{ name = "vsnip" },
|
|
}),
|
|
}),
|
|
completion = {
|
|
completion = {
|
|
autocomplete = false,
|
|
autocomplete = false,
|
|
},
|
|
},
|
|
|
|
+ matching = {
|
|
|
|
+ -- disable non-prefix matching
|
|
|
|
+ disallow_partial_matching = true,
|
|
|
|
+ disallow_prefix_unmatching = true,
|
|
|
|
+ },
|
|
|
|
+ sorting = {
|
|
|
|
+ comparators = {
|
|
|
|
+ -- since we only have prefix matches, just sort the results
|
|
|
|
+ cmp.config.compare.sort_text,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
})
|
|
})
|
|
|
|
|
|
-- typescript-vim compiler options
|
|
-- typescript-vim compiler options
|