{"id":13681995,"url":"https://github.com/dmitmel/cmp-cmdline-history","last_synced_at":"2025-05-05T20:15:32.283Z","repository":{"id":95463589,"uuid":"421793613","full_name":"dmitmel/cmp-cmdline-history","owner":"dmitmel","description":"Source for nvim-cmp which reads results from command-line or search histories","archived":false,"fork":false,"pushed_at":"2022-05-04T08:46:03.000Z","size":6,"stargazers_count":75,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-02T13:33:14.696Z","etag":null,"topics":["nvim-cmp"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmitmel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-10-27T11:39:39.000Z","updated_at":"2024-07-26T01:15:39.000Z","dependencies_parsed_at":"2023-05-04T15:01:49.052Z","dependency_job_id":null,"html_url":"https://github.com/dmitmel/cmp-cmdline-history","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/dmitmel%2Fcmp-cmdline-history","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitmel%2Fcmp-cmdline-history/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitmel%2Fcmp-cmdline-history/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitmel%2Fcmp-cmdline-history/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmitmel","download_url":"https://codeload.github.com/dmitmel/cmp-cmdline-history/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223790993,"owners_count":17203373,"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"],"created_at":"2024-08-02T13:01:38.903Z","updated_at":"2024-11-09T05:36:12.200Z","avatar_url":"https://github.com/dmitmel.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# cmp-cmdline-history\n\n[nvim-cmp](https://github.com/hrsh7th/nvim-cmp) source for getting completions from command-line (`:` or Ex-mode) or search (`/` and `?`) histories. Intended for use with the recently-introduced [cmdline completion feature](https://github.com/hrsh7th/nvim-cmp/pull/362).\n\nSee also: [cmp-cmdline](https://github.com/hrsh7th/cmp-cmdline)\n\n## Usage\n\nBasic example: will complete previously typed Ex commands when in the command-line mode.\n\n```lua\ncmp.setup.cmdline(':', {\n  sources = {\n    { name = 'cmdline_history' },\n  },\n})\n```\n\nA more advanced example: this will also setup the history completion for all other command-line modes.\n\n```lua\nfor _, cmd_type in ipairs({':', '/', '?', '@'}) do\n  cmp.setup.cmdline(cmd_type, {\n    sources = {\n      { name = 'cmdline_history' },\n    },\n  })\nend\n```\n\nBy default this source will read the history for the current mode, but you can also force it to use some other mode with the `history_type` option. The possible values for it can be found in [`:help hist-names`](https://neovim.io/doc/user/builtin.html#hist-names) and [`:help getcmdtype()`](\u003chttps://neovim.io/doc/user/builtin.html#getcmdtype()\u003e). Not sure how this can be useful, but I guess you could use it to autocomplete Ex commands in a Vimscript file:\n\n```vim\nautocmd FileType vim lua require('cmp').setup.buffer({\n\\   sources = {\n\\     {\n\\       name = 'cmdline_history',\n\\       opts = { history_type = ':' },\n\\     },\n\\   },\n\\ })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitmel%2Fcmp-cmdline-history","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmitmel%2Fcmp-cmdline-history","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitmel%2Fcmp-cmdline-history/lists"}