{"id":19309607,"url":"https://github.com/roxma/simpleautocomplpop","last_synced_at":"2025-02-24T03:21:50.874Z","repository":{"id":82181203,"uuid":"62532924","full_name":"roxma/SimpleAutoComplPop","owner":"roxma","description":"Please use https://github.com/ncm2/ncm2 instead","archived":false,"fork":false,"pushed_at":"2017-02-05T15:41:58.000Z","size":12,"stargazers_count":22,"open_issues_count":6,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-06T01:43:52.701Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Vim script","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/roxma.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}},"created_at":"2016-07-04T05:07:00.000Z","updated_at":"2022-08-05T14:08:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"af9c6232-3028-4a91-9f49-f5269501de6c","html_url":"https://github.com/roxma/SimpleAutoComplPop","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/roxma%2FSimpleAutoComplPop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roxma%2FSimpleAutoComplPop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roxma%2FSimpleAutoComplPop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roxma%2FSimpleAutoComplPop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roxma","download_url":"https://codeload.github.com/roxma/SimpleAutoComplPop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240410395,"owners_count":19796885,"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":[],"created_at":"2024-11-10T00:19:57.714Z","updated_at":"2025-02-24T03:21:48.668Z","avatar_url":"https://github.com/roxma.png","language":"Vim script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleAutoComplPop\n\n**Note: I'm not mantaining this plugin anymore, in favor of\n[nvim-completion-manager](https://github.com/roxma/nvim-completion-manager).\nIf you have plans for improving this plugin by yourself, please contact me, I'll\ntransfer the project ownership.**\n\nA simplified fork from [vim-scripts/AutoComplPop](https://github.com/vim-scripts/AutoComplPop)\n\nSimpleAutoComplPop is a **lightweight**, **pure vimscript** plugin, which\nfocuses on **easy to use**, and **easy to be extended** for your own use cases.\nSACP **maps keys on a per-buffer basis**. Technically it will not conflict with\nother auto-complete plugin if you configure carefully. \n\n# Usage\n\nCurrently, SACP only provides default configurations for php, go, txt and\nmarkdown files.\n\n## PHP\n\n```vim\n\tautocmd FileType php,php5,php7 call sacp#enableForThisBuffer({ \"matches\": [\n\t\t\t\t\\ { '=~': '\\v[a-zA-Z]{4}$', 'feedkeys': \"\\\u003cC-x\u003e\\\u003cC-o\u003e\"},\n\t\t\t\t\\ { '=~': '::$'           , 'feedkeys': \"\\\u003cC-x\u003e\\\u003cC-o\u003e\"},\n\t\t\t\t\\ { '=~': '-\u003e$'           , 'feedkeys': \"\\\u003cC-x\u003e\\\u003cC-o\u003e\"},\n\t\t\t\t\\ ]\n\t\t\t\t\\ })\n```\n\nThis demo requires [phpcomplete.vim](https://github.com/shawncplus/phpcomplete.vim).\n\n\n![php_demo](https://github.com/roxma/SimpleAutoComplPop.img/blob/master/usage_php_demo.gif)\n\n## Golang\n\n```vim\n\t\" 1. variables are all defined in current scope, use keyword from current\n\t\" buffer for completion `\u003cC-x\u003e\u003cC-n\u003e`\n\t\" 2. When the '.' is pressed, use smarter omnicomplete `\u003cC-x\u003e\u003cC-o\u003e`, this\n\t\" works well with the vim-go plugin\n\tautocmd FileType go call sacp#enableForThisBuffer({ \"matches\": [\n\t\t\t\t\\ { '=~': '\\v[a-zA-Z]{4}$' , 'feedkeys': \"\\\u003cC-x\u003e\\\u003cC-n\u003e\"} ,\n\t\t\t\t\\ { '=~': '\\.$'            , 'feedkeys': \"\\\u003cC-x\u003e\\\u003cC-o\u003e\", \"ignoreCompletionMode\":1} ,\n\t\t\t\t\\ ]\n\t\t\t\t\\ })\n```\n\nThis demo requires [vim-go](https://github.com/fatih/vim-go).\n\n![go_demo](https://github.com/roxma/SimpleAutoComplPop.img/blob/master/usage_go_demo.gif)\n\nSeems good. While SACP provides **a slightly improved\nplugin key\n[`\u003cPlug\u003e(sacp_cache_fuzzy_omnicomplete)`](#plugsacp_cache_fuzzy_omnicomplete)**.\nCheck the [Advanced Features](#advanced-features) section For more details.\n\n\n## Configiration Options Explained\n\n- To disable SACP, add `let g:sacpEnable = 0` to your vimrc file.\n- To enable the default auto-complete-popup behavior for php only, add `let\n    g:sacpDefaultFileTypesEnable = {\"php\":1}` to your vimrc file.\n- **sacp#enableForThisBuffer** options: \n    - **matches** is a list of patterns, pattern is matched, the keys\n        corrosponding the pattern will be feed to vim.\n        - **ignoreCompletionMode**. By default, Keys will not be feeded by SACP\n            if popup enu is visible or vim is still in completion mode (`:help\n            CompleteDone`).  However, It's difficult for complete-functions to\n            leave completion mode properly.  With current version of\n            [vim-go](https://github.com/fatih/vim-go) plugin for example, when\n            I type `htt\u003cC-X\u003e\u003cC-O\u003e` it will popup a list containing `http`, then\n            I proceed the typing to `htt\u003cC-X\u003e\u003cC-O\u003ep.`.  When the `.` is typed\n            the popup menu is gone, but the event `CompleteDone` event is not\n            triggered. Set the `ignoreCompletionMode` to `1` would force\n            SACP to feed the `\u003cC-X\u003e\u003cC-O\u003e` keys..\n    - **completeopt**, the default value for this option is\n        `\"menu,menuone,noinsert,noselect\"`, set it to `\"menu,menuone,noinsert\"`\n        if you want the first hint to be selected by default.\n\n\n## Advanced Features\n\n### `\u003cPlug\u003e(sacp_cache_fuzzy_omnicomplete)`\n\nUse the golang example before, I'll change the `\\\u003cC-x\u003e\\\u003cC-o\u003e` into\n`\\\u003cPlug\u003e(sacp_cache_fuzzy_omnicomplete)`. This key is based on user's default\nomnifunc, it catches the first list return by omnifunc, then provide fuzzy\ncompletion feature.\n\n```\n\t\" 1. variables are all defined in current scope, use keyword from current\n\t\" buffer for completion `\u003cC-x\u003e\u003cC-n\u003e`\n\t\" 2. When the '.' is pressed, use smarter omnicomplete `\u003cC-x\u003e\u003cC-o\u003e`, this\n\t\" works well with the vim-go plugin\n\tautocmd FileType go call sacp#enableForThisBuffer({ \"matches\": [\n\t\t\t\t\\ { '=~': '\\v[a-zA-Z]{2}$' , 'feedkeys': \"\\\u003cC-x\u003e\\\u003cC-n\u003e\"} ,\n\t\t\t\t\\ { '=~': '\\.$'            , 'feedkeys': \"\\\u003cPlug\u003e(sacp_cache_fuzzy_omnicomplete)\", \"ignoreCompletionMode\":1} ,\n\t\t\t\t\\ ]\n\t\t\t\t\\ })\n```\n\nType `http.ok`, then there goes the first hint `StatusOk`\n\n\n![go_demo](https://github.com/roxma/SimpleAutoComplPop.img/blob/master/advanced_go_demo.gif)\n\n\n\n### `\u003cPlug\u003e(sacp_cache_fuzzy_bufferkeyword_complete)`\n\nUse the keywords (`:help iskeyword`) from current buffer for fuzzy completion.\nIt only scans the keywords from the 50 lines before and after the current line,\nfor performance issue.  Use the golang example, replace the `\"\\\u003cC-x\u003e\\\u003cC-n\u003e\"`\nwith `\"\\\u003cPlug\u003e(sacp_cache_fuzzy_bufferkeyword_complete)\"` and see what happens.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froxma%2Fsimpleautocomplpop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froxma%2Fsimpleautocomplpop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froxma%2Fsimpleautocomplpop/lists"}