{"id":29942820,"url":"https://github.com/mikavilpas/blink-ripgrep.nvim","last_synced_at":"2025-10-27T23:14:34.185Z","repository":{"id":260898571,"uuid":"882598783","full_name":"mikavilpas/blink-ripgrep.nvim","owner":"mikavilpas","description":"Ripgrep/gitgrep source for the blink.cmp Neovim completion plugin","archived":false,"fork":false,"pushed_at":"2025-09-12T14:23:39.000Z","size":1370,"stargazers_count":81,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-12T16:43:36.636Z","etag":null,"topics":["neovim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"niuiic/blink-cmp-rg.nvim","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikavilpas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-03T09:32:37.000Z","updated_at":"2025-09-12T14:23:42.000Z","dependencies_parsed_at":"2025-09-04T17:15:02.840Z","dependency_job_id":null,"html_url":"https://github.com/mikavilpas/blink-ripgrep.nvim","commit_stats":null,"previous_names":["mikavilpas/blink-cmp-rg.nvim","mikavilpas/blink-ripgrep.nvim"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mikavilpas/blink-ripgrep.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikavilpas%2Fblink-ripgrep.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikavilpas%2Fblink-ripgrep.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikavilpas%2Fblink-ripgrep.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikavilpas%2Fblink-ripgrep.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikavilpas","download_url":"https://codeload.github.com/mikavilpas/blink-ripgrep.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikavilpas%2Fblink-ripgrep.nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275207875,"owners_count":25423896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neovim-plugin"],"created_at":"2025-08-03T02:03:22.372Z","updated_at":"2025-10-27T23:14:34.161Z","avatar_url":"https://github.com/mikavilpas.png","language":"Lua","funding_links":[],"categories":["Lua","Completion"],"sub_categories":["Diagnostics"],"readme":"# blink-ripgrep.nvim\n\n\u003ca href=\"https://dotfyle.com/plugins/mikavilpas/blink-ripgrep.nvim\"\u003e\n  \u003cimg\n    src=\"https://dotfyle.com/plugins/mikavilpas/blink-ripgrep.nvim/shield?style=flat-square\"\n    alt=\"shield image for plugin usage\"\n  /\u003e\n\u003c/a\u003e\n\nRipgrep / git grep source for the\n[blink.cmp](https://github.com/Saghen/blink.cmp) completion plugin. Adding it to\nyour configuration offers matching words from your entire project as\ncompletions. This can reduce the chance of typos as well as repetitive typing.\n\nIt offers two search backends:\n\n- **ripgrep** (`rg`): works out of the box for any project or directory\n- **git grep**: is faster than `rg`, and works only for projects that are\n  tracked by git\n  - only searches files that are tracked by git\n  - recommended: enable by setting `backend.use = \"gitgrep-or-ripgrep\"` (see\n    below)\n\n\u003e [!NOTE]\n\u003e\n\u003e By default, a project root is considered to be the nearest ancestor directory\n\u003e containing a `.git` directory. This can be configured with the\n\u003e `project_root_marker` option.\n\n![blink-ripgrep search with a context preview](./demo/screenshot.png)\n\nForked here (mikavilpas/blink.cmp) for my own use from\n[niuiic/blink-cmp-rg.nvim](https://github.com/niuiic/blink-cmp-rg.nvim).\n\n## 📦 Installation\n\nThe configuration of blink-ripgrep needs to be embedded into the configuration\nfor blink.\n\n### Minimal config\n\nYou can use this config to quickly get started with the defaults.\n\nExample for [lazy.nvim](https://lazy.folke.io/):\n\n```lua\n-- NOTE: you can leave out the type annotations if you don't want to use them\n\n---@module \"lazy\"\n---@type LazySpec\nreturn {\n  \"saghen/blink.cmp\",\n  dependencies = {\n    {\n      \"mikavilpas/blink-ripgrep.nvim\",\n      version = \"*\", -- use the latest stable version\n    }\n    -- 👆🏻👆🏻 add the dependency here\n  },\n  ---@module 'blink.cmp'\n  ---@type blink.cmp.Config\n  opts = {\n    sources = {\n      default = {\n        \"buffer\",\n        \"ripgrep\", -- 👈🏻 add \"ripgrep\" here\n      },\n      providers = {\n        -- 👇🏻👇🏻 add the ripgrep provider config below\n        ripgrep = {\n          module = \"blink-ripgrep\",\n          name = \"Ripgrep\",\n          -- see the full configuration below for all available options\n          ---@module \"blink-ripgrep\"\n          ---@type blink-ripgrep.Options\n          opts = {},\n        },\n      },\n    },\n  },\n}\n```\n\n### Full config\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand the full config\u003c/summary\u003e\n\nExample for [lazy.nvim](https://lazy.folke.io/):\n\n```lua\n-- NOTE: you can leave out the type annotations if you don't want to use them\n\n---@module \"lazy\"\n---@type LazySpec\nreturn {\n  \"saghen/blink.cmp\",\n  dependencies = {\n    {\n      \"mikavilpas/blink-ripgrep.nvim\",\n      version = \"*\", -- use the latest stable version\n    },\n    -- 👆🏻👆🏻 add the dependency here\n\n    -- optional dependency used for toggling features on/off\n    -- https://github.com/folke/snacks.nvim\n    \"folke/snacks.nvim\",\n  },\n  ---@module 'blink.cmp'\n  ---@type blink.cmp.Config\n  opts = {\n    sources = {\n      default = {\n        \"buffer\",\n        \"ripgrep\", -- 👈🏻 add \"ripgrep\" here\n      },\n      providers = {\n        -- 👇🏻👇🏻 add the ripgrep provider config below\n        ripgrep = {\n          module = \"blink-ripgrep\",\n          name = \"Ripgrep\",\n          -- the options below are optional, some default values are shown\n          ---@module \"blink-ripgrep\"\n          ---@type blink-ripgrep.Options\n          opts = {\n            -- the minimum length of the current word to start searching\n            -- (if the word is shorter than this, the search will not start)\n            prefix_min_len = 3,\n\n            -- Specifies how to find the root of the project where the ripgrep\n            -- search will start from. Accepts the same options as the marker\n            -- given to `:h vim.fs.root()` which offers many possibilities for\n            -- configuration. If none can be found, defaults to Neovim's cwd.\n            --\n            -- Examples:\n            -- - \".git\" (default)\n            -- - { \".git\", \"package.json\", \".root\" }\n            project_root_marker = \".git\",\n\n            -- When a result is found for a file whose filetype does not have a\n            -- treesitter parser installed, fall back to regex based highlighting\n            -- that is bundled in Neovim.\n            fallback_to_regex_highlighting = true,\n\n            -- Keymaps to toggle features on/off. This can be used to alter\n            -- the behavior of the plugin without restarting Neovim. Nothing\n            -- is enabled by default. Requires folke/snacks.nvim.\n            toggles = {\n              -- The keymap to toggle the plugin on and off from blink\n              -- completion results. Example: \"\u003cleader\u003etg\" (\"toggle grep\")\n              on_off = nil,\n\n              -- The keymap to toggle debug mode on/off. Example: \"\u003cleader\u003etd\" (\"toggle debug\")\n              debug = nil,\n            },\n\n            backend = {\n              -- The backend to use for searching. Defaults to \"ripgrep\".\n              -- Available options:\n              -- - \"ripgrep\", always use ripgrep\n              -- - \"gitgrep\", always use git grep\n              -- - \"gitgrep-or-ripgrep\", use git grep if possible, otherwise\n              --   use ripgrep. Uses the same options as the gitgrep backend\n              use = \"ripgrep\",\n\n              -- Whether to set up custom highlight-groups for the icons used\n              -- in the completion items. Defaults to `true`, which means this\n              -- is enabled.\n              customize_icon_highlight = true,\n\n              ripgrep = {\n                -- For many options, see `rg --help` for an exact description of\n                -- the values that ripgrep expects.\n\n                -- The number of lines to show around each match in the preview\n                -- (documentation) window. For example, 5 means to show 5 lines\n                -- before, then the match, and another 5 lines after the match.\n                context_size = 5,\n\n                -- The maximum file size of a file that ripgrep should include\n                -- in its search. Useful when your project contains large files\n                -- that might cause performance issues.\n                -- Examples:\n                -- \"1024\" (bytes by default), \"200K\", \"1M\", \"1G\", which will\n                -- exclude files larger than that size.\n                max_filesize = \"1M\",\n\n                -- Enable fallback to neovim cwd if project_root_marker is not\n                -- found. Default: `true`, which means to use the cwd.\n                project_root_fallback = true,\n\n                -- The casing to use for the search in a format that ripgrep\n                -- accepts. Defaults to \"--ignore-case\". See `rg --help` for\n                -- all the available options ripgrep supports, but you can try\n                -- \"--case-sensitive\" or \"--smart-case\".\n                search_casing = \"--ignore-case\",\n\n                -- (advanced) Any additional options you want to give to\n                -- ripgrep. See `rg -h` for a list of all available options.\n                -- Might be helpful in adjusting performance in specific\n                -- situations. If you have an idea for a default, please open\n                -- an issue!\n                --\n                -- Not everything will work (obviously).\n                additional_rg_options = {},\n\n                -- Absolute root paths where the rg command will not be\n                -- executed. Usually you want to exclude paths using gitignore\n                -- files or ripgrep specific ignore files, but this can be used\n                -- to only ignore the paths in blink-ripgrep.nvim, maintaining\n                -- the ability to use ripgrep for those paths on the command\n                -- line. If you need to find out where the searches are\n                -- executed, enable `debug` and look at `:messages`.\n                ignore_paths = {},\n\n                -- Any additional paths to search in, in addition to the\n                -- project root. This can be useful if you want to include\n                -- dictionary files (/usr/share/dict/words), framework\n                -- documentation, or any other reference material that is not\n                -- available within the project root.\n                additional_paths = {},\n              },\n            },\n\n            gitgrep = {\n              -- Any extra options you want to give to git grep. Can be used to\n              -- e.g. exclude some files from the search.\n              additional_gitgrep_options = {}\n            },\n\n            -- Show debug information in `:messages` that can help in\n            -- diagnosing issues with the plugin.\n            debug = false,\n          },\n          -- (optional) customize how the results are displayed. Many options\n          -- are available - make sure your lua LSP is set up so you get\n          -- autocompletion help\n          transform_items = function(_, items)\n            for _, item in ipairs(items) do\n              -- example: append a description to easily distinguish rg results\n              item.labelDetails = {\n                description = \"(rg)\",\n              }\n            end\n            return items\n          end,\n        },\n      },\n      keymap = {\n        -- 👇🏻👇🏻 (optional) add a keymap to invoke the search manually\n        [\"\u003cc-g\u003e\"] = {\n          function()\n            require(\"blink-cmp\").show({ providers = { \"ripgrep\" } })\n          end,\n        },\n      },\n    },\n  },\n}\n```\n\n\u003c/details\u003e\n\n## 🏁 Performance\n\nGenerally performance is very good, but depending on the size of your project\nand your computer's specifications, the search can be fast or slow. Here are a\nfew things you can do to improve performance:\n\n- Use the git grep backend by setting the `backend = \"gitgrep\"` option (see\n  above). This can be faster in medium/large projects, but note that it only\n  provides results from files that are tracked by git.\n- Set the `prefix_min_len` option to a larger number avoid starting a search for\n  very short words. This can prevent unnecessary searches and improve\n  performance.\n- Use the `max_filesize` option to exclude large files from the search. This can\n  prevent performance issues when searching in projects with large files.\n- Disable automatic mode and use the manual mode to start the search only when\n  you need it (see below).\n- Set the `debug = true` option, which will log debug information to your\n  `:messages` in Neovim. You can copy paste these commands to your terminal and\n  try to figure out why the search is slow.\n- Use the search backend's options to exclude/include files\n  - ripgrep supports global as well as project/directory specific ignore files.\n    By default, it uses `.gitignore`, `.git/info/exclude`, `.ignore`, and\n    `.rgignore` files\n    ([ripgrep docs](https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#automatic-filtering))\n  - git grep can be configured to ignore files using `.gitattributes` files. See\n    [documentation/ignore-files-from-git-grep.md](documentation/ignore-files-from-git-grep.md)\n    for more information.\n\n- If you still experience performance issues, please open an issue for\n  discussion.\n\n### Automatic mode\n\nIn this mode, the search starts automatically when typing a word that is at\nleast `prefix_min_len` in length.\n\nThis is enabled by including the `ripgrep` provider in blink-cmp's providers:\n\n```lua\nreturn {\n  -- ... other configuration\n  ---@module 'blink.cmp'\n  ---@type blink.cmp.Config\n  opts = {\n    sources = {\n      default = {\n        \"lsp\",\n        \"path\",\n        \"snippets\",\n        \"buffer\",\n        \"ripgrep\", -- 👈🏻 including this enables automatic search\n      },\n    }\n  }\n}\n```\n\n### Manual mode\n\nIf you prefer to start the search manually, you can use a keymap to invoke the\nsearch. The example configuration includes a keymap that invokes the search when\npressing `Ctrl+g`.\n\n## Highlight groups\n\nThe plugin uses the following highlight groups to style the results:\n\n- `BlinkCmpKindRipgrepRipgrep` - the color of the icon used for ripgrep results\n- `BlinkCmpKindRipgrepGit` - the color of the icon used for git grep results\n\n## 🤔 How it works\n\nWhen you enter insert mode and start typing a word, blink triggers a search with\nblink-ripgrep. Only one search is done to save resources. After getting the\nresults, the following keys are used to filter the results.\n\nIn this demo (using the option `debug = true` above), we can see the search\nstarting when the word flashes with a different color. Notice how the word only\nflashes once:\n\n\u003c!-- TODO add a better demo --\u003e\n\n\u003chttps://github.com/user-attachments/assets/0651ad24-0403-4ab9-81ff-59b152283593\u003e\n\nThis is described in much more detail in blink's\n[architecture documentation](https://cmp.saghen.dev/development/architecture.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikavilpas%2Fblink-ripgrep.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikavilpas%2Fblink-ripgrep.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikavilpas%2Fblink-ripgrep.nvim/lists"}