{"id":19295398,"url":"https://github.com/jsit/vim-customcpt","last_synced_at":"2025-04-22T08:30:46.632Z","repository":{"id":71935148,"uuid":"78043383","full_name":"jsit/vim-customcpt","owner":"jsit","description":"Easily create custom completion menus using any json or tab-separated file","archived":false,"fork":false,"pushed_at":"2017-01-09T14:42:32.000Z","size":115,"stargazers_count":22,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T21:12:03.413Z","etag":null,"topics":["completion","plugin","vim"],"latest_commit_sha":null,"homepage":"","language":"VimL","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/jsit.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":"2017-01-04T18:52:48.000Z","updated_at":"2023-09-12T03:35:40.000Z","dependencies_parsed_at":"2024-05-29T19:19:40.198Z","dependency_job_id":null,"html_url":"https://github.com/jsit/vim-customcpt","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/jsit%2Fvim-customcpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsit%2Fvim-customcpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsit%2Fvim-customcpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsit%2Fvim-customcpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsit","download_url":"https://codeload.github.com/jsit/vim-customcpt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250206017,"owners_count":21392166,"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":["completion","plugin","vim"],"created_at":"2024-11-09T22:43:22.727Z","updated_at":"2025-04-22T08:30:46.620Z","avatar_url":"https://github.com/jsit.png","language":"VimL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vim-customcpt\n\nEasily create custom completion menus using any dictionary/json file, in the format:\n\n`{ \"word(\" : { \"kind\" : \"f\", \"menu\" : \"menu\", \"info\" : \"info\" } }`\n\n*Or* a tab-separated values file, like this:\n\n`word   kind    menu    info`\n\nSo, for instance, a WordPress function (a full example wordpress.json file is included in this repo):\n\n```\n{\n  \"get_bloginfo(\" : {\n    \"kind\" : \"f\",\n    \"menu\" : \"string $show, string $filter | string\",\n    \"info\" : \"Retrieves information about the current site.\",\n  }\n}\n```\n\n\nOr, as tab-separated values:\n\n`get_bloginfo(\tf\tstring $show, string $filter | string\tRetrieves information about the current site.`\n\nSee `:help complete-items` for more info:\n\n```\nword\t\tthe text that will be inserted, mandatory\nkind\t\tsingle letter indicating the type of completion\nmenu\t\textra text for the popup menu, displayed after \"word\"\n            or \"abbr\"\ninfo\t\tmore information about the item, can be displayed in a\n            preview window\n```\n\nYour custom completion file will show up as a \"full\" complete menu similar to the omnicomplete menu, like so:\n\n![](http://i.imgur.com/rxbVIdH.png)\n\n## Options\n\nBy itself, this plugin does nothing. Only by setting a couple dictionaries in your .vimrc will `\u003cC-X\u003e\u003cC-U\u003e` use the completion function generated by your file.\n\n`g:customcpt_funcs` (required): A Dictionary with a function name for a key and a List of files to use for completion with it\n\n```\nlet g:customcpt_funcs = {\n\t\t\\ \"WPComplete\" : [\n\t\t\t\\ $HOME . \"/.vim/wordpress.json\",\n\t\t\\ ]\n\t\\ }\nendif\n```\n\n`g:customcpt_types` (optional): A Dictionary with a comma-separated list of filetypes as keys and the name of a completion function to use with them\n\n```\nlet g:customcpt_types =  {\n        \\ \"php,php.html\" : \"WPComplete\",\n\t\\ }\nendif\n```\n\nAlternatively, you could just do something like this in your .vimrc:\n\n`au FileType php,php.html setlocal completefunc=WPComplete`\n\n## Thanks\n\nThis plugin is heavily based on @aaronspring\u0026rsquo;s [cdo_lazy_vim](https://github.com/aaronspring/cdo_lazy_vim) plugin. Thanks Aaron! \u0026#x1F44B;\n\nThanks also to Steve Losh\u0026rsquo;s [Learn Vimscript the Hard Way](http://learnvimscriptthehardway.stevelosh.com) and the Stack Exchange community.\n\n---\n\nRelated: [CompleteHelper](http://www.vim.org/scripts/script.php?script_id=3914)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsit%2Fvim-customcpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsit%2Fvim-customcpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsit%2Fvim-customcpt/lists"}