feat(blink.cmp): add ripgrep to blink sources
Allows getting additional suggestions via ripgrep in blink.cmp. Source is added to the end of the suggestions list and will search the full project directory (within size/root limits)
This commit is contained in:
@@ -33,6 +33,9 @@ if vim.g.useblinkcmp then
|
||||
return {
|
||||
{
|
||||
'saghen/blink.cmp',
|
||||
dependencies = {
|
||||
'mikavilpas/blink-ripgrep.nvim',
|
||||
},
|
||||
opts = {
|
||||
enabled = function()
|
||||
return not vim.tbl_contains({ 'minifiles' }, vim.bo.filetype)
|
||||
@@ -106,6 +109,29 @@ if vim.g.useblinkcmp then
|
||||
return 0
|
||||
end,
|
||||
},
|
||||
ripgrep = {
|
||||
module = 'blink-ripgrep',
|
||||
name = 'Ripgrep',
|
||||
opts = {
|
||||
search_casing = '--smart-case',
|
||||
},
|
||||
transform_items = function(_, items)
|
||||
for _, item in ipairs(items) do
|
||||
-- example: append a description to easily distinguish rg results
|
||||
item.labelDetails = {
|
||||
description = ' ',
|
||||
}
|
||||
end
|
||||
return items
|
||||
end,
|
||||
},
|
||||
},
|
||||
default = {
|
||||
'lsp',
|
||||
'path',
|
||||
'snippets',
|
||||
'buffer',
|
||||
'ripgrep',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user