From e0c32bb11908c22c3a8a473dd43e79b717651364 Mon Sep 17 00:00:00 2001 From: rootiest Date: Wed, 26 Mar 2025 00:01:46 -0400 Subject: [PATCH] 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) --- lua/plugins/cmp.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index ab0d4cc..cccb3a7 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -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', }, }, },