{"id":13681991,"url":"https://github.com/tzachar/cmp-fuzzy-path","last_synced_at":"2026-02-04T14:23:04.270Z","repository":{"id":46279789,"uuid":"423865355","full_name":"tzachar/cmp-fuzzy-path","owner":"tzachar","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-17T10:58:14.000Z","size":27,"stargazers_count":68,"open_issues_count":1,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-02T13:33:13.519Z","etag":null,"topics":["nvim-cmp","nvim-plugins"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tzachar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-11-02T13:58:52.000Z","updated_at":"2024-07-18T19:59:04.000Z","dependencies_parsed_at":"2023-12-28T10:46:47.471Z","dependency_job_id":"288a3ba1-e564-41a4-9a0f-376199264ead","html_url":"https://github.com/tzachar/cmp-fuzzy-path","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzachar%2Fcmp-fuzzy-path","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzachar%2Fcmp-fuzzy-path/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzachar%2Fcmp-fuzzy-path/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzachar%2Fcmp-fuzzy-path/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tzachar","download_url":"https://codeload.github.com/tzachar/cmp-fuzzy-path/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224201798,"owners_count":17272645,"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","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":["nvim-cmp","nvim-plugins"],"created_at":"2024-08-02T13:01:38.818Z","updated_at":"2026-02-04T14:23:04.205Z","avatar_url":"https://github.com/tzachar.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# cmp-fuzzy-path\n\n`nvim-cmp` source for filesystem paths, employing `fd` and regular expressions to\nfind files.\n\nDepends on [fuzzy.nvim](https://github.com/tzachar/fuzzy.nvim) (which depends\neither on `fzf` or on `fzy`).\n\nTo facilitate fuzzy matching, when `cmp-fuzzy-path` tries to find a path the\npath is first transformed to a regular expression like this: `p/t/f` --\u003e\n`p.*/.*t.*/.*f.'`, which will match `path/to/file` and also\n`pa/toooo/other_file`.\n\nTo prevent excessive invocations of this plugin, the completion will only be\ntriggered when the string currently being entered matches a path regular\nexpression. To quickly trigger completions, make sure to either use a leading `/`\nor a leading './'\n\nIn spcecial cases, while in command mode, the plugin will be invoked regardless\nto facilitate faster file searching. This behaviour is implemented only when the\nfirst character of the command is in `{'e', 'w'}`.\n\n# Installation\n\nUsing [Packer](https://github.com/wbthomason/packer.nvim/) with `fzf`:\n```lua\nuse {'nvim-telescope/telescope-fzf-native.nvim', run = 'make'}\nuse \"hrsh7th/nvim-cmp\"\nuse {'tzachar/cmp-fuzzy-path', requires = {'hrsh7th/nvim-cmp', 'tzachar/fuzzy.nvim'}}\n```\n\nUsing [Packer](https://github.com/wbthomason/packer.nvim/) with `fzy`:\n```lua\nuse {'romgrk/fzy-lua-native', run = 'make'}\nuse \"hrsh7th/nvim-cmp\"\nuse {'tzachar/cmp-fuzzy-path', requires = {'hrsh7th/nvim-cmp', 'tzachar/fuzzy.nvim'}}\n```\n\nYou should have `fd` in your `PATH`, or edit the configuation to point at the\nexact location.\n\n\n# Setup\n\n```lua\nrequire'cmp'.setup {\n  sources = cmp.config.sources({\n    { name = 'fuzzy_path'},\n  })\n}\n```\n\nThis plugin can also be used to complete file names for `:edit` or `:write` in cmdline mode of cmp:\n```lua\ncmp.setup.cmdline(':', {\n  sources = cmp.config.sources({\n    { name = 'fuzzy_path' }\n  })\n})\n```\n\n*Note:* the plugin's name is `fuzzy_path` in `cmp`'s config.\n\n\n# Configuration\n\nConfiguration can be passed when configuring `cmp`:\n\n```lua\ncmp.setup.cmdline(':', {\n  sources = cmp.config.sources({\n    { name = 'fuzzy_path', option = {fd_timeout_msec = 1500} }\n  })\n})\n```\n\n## fd_timeout_msec (type: int)\n\n_Default:_ 500\n\nHow much grace to give the file finder before killing it. If you set this to too\nshort a value, you will probably not get enough suggestions.\n\n## fd_cmd (type: table(string))\n\n_Default:_ `{'fd', '-d', '20', '-p'}`\n\nThe commend to use as a file finder. Note that `-p` is needed so we match on the\nentire path, not just on the file or directory name.\n\nPlease note that, by default, `fd` returns only files. If you want directories,\nyou need to add `-t d -t f` to `fd_cmd` table.\n\n# Sorting\n\n`cmp-fuzzy-path` adds a score entry to each completion item's `data` field,\nwhich can be used to override `cmp`'s default sorting order:\n\n\n```lua\nlocal compare = require('cmp.config.compare')\ncmp.setup({\n  sorting = {\n    priority_weight = 2,\n    comparators = {\n      require('cmp_fuzzy_path.compare'),\n      compare.offset,\n      compare.exact,\n      compare.score,\n      compare.recently_used,\n      compare.kind,\n      compare.sort_text,\n      compare.length,\n      compare.order,\n    },\n  },\n}\n```\n\n# Commands\n\n`cmp-fuzzy-path` add the following commands:\n\n## `CmpFuzzyStats`\n\n`CmpFuzzyStats` can be used to gather statistics about the operation of the\nplugin. Output contains the following: \n\n- Total Usage Count: how many times the plugin was called\n- Timeout Count: how many times we reached a timeout\n- Average Search Time: the average time it took to complete the search\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftzachar%2Fcmp-fuzzy-path","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftzachar%2Fcmp-fuzzy-path","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftzachar%2Fcmp-fuzzy-path/lists"}