{"id":21261889,"url":"https://github.com/nchern/go-snip","last_synced_at":"2026-05-19T07:31:47.765Z","repository":{"id":149981418,"uuid":"170928578","full_name":"nchern/go-snip","owner":"nchern","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-03T21:29:27.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-04-02T13:28:45.292Z","etag":null,"topics":["command-line","golang","snippets","vim"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nchern.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2019-02-15T21:09:41.000Z","updated_at":"2024-06-19T10:13:02.960Z","dependencies_parsed_at":null,"dependency_job_id":"e1c9248a-ed22-4d0c-b7cd-ca528d9db2ae","html_url":"https://github.com/nchern/go-snip","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/nchern/go-snip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nchern%2Fgo-snip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nchern%2Fgo-snip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nchern%2Fgo-snip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nchern%2Fgo-snip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nchern","download_url":"https://codeload.github.com/nchern/go-snip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nchern%2Fgo-snip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000726,"owners_count":26082862,"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-10-08T02:00:06.501Z","response_time":56,"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":["command-line","golang","snippets","vim"],"created_at":"2024-11-21T04:56:11.880Z","updated_at":"2025-10-08T23:10:55.418Z","avatar_url":"https://github.com/nchern.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/nchern/go-snip)](https://goreportcard.com/report/github.com/nchern/go-snip)\n\n# go-snip\n\nLightweight [Neosnippet](https://github.com/Shougo/neosnippet-snippets/tree/master/neosnippets) parser and processor. Just an experiment how to get snippets in vim w/o dealing with many various plugins.\n\nThe current implementation reads all the `*.snip` files in `~/.vim` dir recursively each time the command is invoked.\n\n## Install \n```bash\ngo get github.com/nchern/go-snip/...\n```\n\n## Usage\n\n### Command line\n\n```bash\n$ go-snip -g=go -cmd=show fori 'foo()' index MAX \nfor index := 0; index \u003c MAX; index++ {\nfoo()\n}\n```\n\n### Plug it into vim\n\nLet's say we want to have snippets for golang in vim. Install the command and then just add the following lines into your `.vimrc`:\n\n```vim\n\"\" Map GoSnip command to call the util\ncommand! -range -nargs=* -complete=custom,ListSnippets GoSnip :\u003cline1\u003e,\u003cline2\u003e!go-snip -g=go -cmd=show \u003cargs\u003e\n\"\" Enable autocomplete for GoSnip command\n:fun ListSnippets(A,L,P)\n:    return system(\"go-snip -g=go -cmd=ls\")\n:endfun\n```\n\nThen in the command mode you can run a command like this: `:GoSnip fori 'foo()' index MAX`. It will insert the `for i ..` snippet at the cursor position.\n.\n## TODO\n- [ ] read snippets from cache file at least for name listing\n- [ ] configurable snippets search root\n- [ ] multi search roots\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnchern%2Fgo-snip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnchern%2Fgo-snip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnchern%2Fgo-snip/lists"}