|
@@ -160,6 +160,7 @@ require('treesj').setup({
|
|
|
|
|
|
-- completion
|
|
|
local cmp = require('cmp')
|
|
|
+local cmp_types = require('cmp.types')
|
|
|
cmp.setup({
|
|
|
snippet = {
|
|
|
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.
|
|
|
}),
|
|
|
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" },
|
|
|
}),
|
|
|
completion = {
|
|
|
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
|