{"id":19238231,"url":"https://github.com/olical/vim-syntax-expand","last_synced_at":"2026-06-27T21:30:17.184Z","repository":{"id":33681656,"uuid":"37334413","full_name":"Olical/vim-syntax-expand","owner":"Olical","description":"Expand characters to code if not in a comment or string","archived":false,"fork":false,"pushed_at":"2016-07-07T20:27:08.000Z","size":5,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-05T02:10:18.498Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"VimL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Olical.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}},"created_at":"2015-06-12T17:11:01.000Z","updated_at":"2023-08-15T14:12:13.000Z","dependencies_parsed_at":"2022-09-11T16:31:49.401Z","dependency_job_id":null,"html_url":"https://github.com/Olical/vim-syntax-expand","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/Olical%2Fvim-syntax-expand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olical%2Fvim-syntax-expand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olical%2Fvim-syntax-expand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olical%2Fvim-syntax-expand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Olical","download_url":"https://codeload.github.com/Olical/vim-syntax-expand/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240324061,"owners_count":19783453,"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-09T16:29:58.835Z","updated_at":"2026-06-27T21:30:17.152Z","avatar_url":"https://github.com/Olical.png","language":"VimL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vim-syntax-expand\n\nThis contains functions to expand a character to a string as long as your cursor isn't currently inside a string or comment syntax element. This essentially allows you to have single character abbreviations that only apply to actual syntax. Please check the doc directory for more information.\n\nHere's how I use it with conceal in JavaScript to create a cute language on top of JavaScript that doesn't affect anyone else.\n\n[![asciicast](https://asciinema.org/a/ag49t530108fu0qp2cuefondl.png)](https://asciinema.org/a/ag49t530108fu0qp2cuefondl)\n\n## Installation\n\nUse your favourite plugin manager, you know the drill. I like [vim-plug][], so here's how you'd install it with that.\n\n```vim\nPlug 'Wolfy87/vim-syntax-expand'\n```\n\n## Usage\n\nHere's my example configuration for JavaScript. The conceal functionality is provided by [vim-javascript][] (which is fantastic).\n\n```vim\n\" Map the conceal characters to their expanded forms (only for javascript files)\nautocmd FileType javascript inoremap \u003csilent\u003e \u003cbuffer\u003e @ \u003cC-r\u003e=syntax_expand#expand(\"@\", \"this\")\u003cCR\u003e\nautocmd FileType javascript inoremap \u003csilent\u003e \u003cbuffer\u003e # \u003cC-r\u003e=syntax_expand#expand(\"#\", \".prototype.\")\u003cCR\u003e\nautocmd FileType javascript inoremap \u003csilent\u003e \u003cbuffer\u003e \u003c \u003cC-r\u003e=syntax_expand#expand_head(\"\u003c\", \"return\")\u003cCR\u003e\n\n\" Keeps everything concealed at all times. Even when my cursor is on the word.\nset conceallevel=1\nset concealcursor=nvic\n\n\" JavaScript thanks to pangloss/vim-javascript\nlet g:javascript_conceal_function = \"λ\"\nlet g:javascript_conceal_this = \"@\"\nlet g:javascript_conceal_return = \"\u003c\"\nlet g:javascript_conceal_prototype = \"#\"\n```\n\nSo now when I type `@` it is actually expanded to `this` but I still see it as `@`. Cool, right? This will work for other languages too, you just need to set up your conceal rules (there's usually a plugin) and some expansion bindings.\n\n## Author\n\n[Oliver Caldwell][] / [@OliverCaldwell][]\n\n## Unlicenced\n\nFind the full [unlicense][] in the `UNLICENSE` file, but here's a snippet.\n\n\u003eThis is free and unencumbered software released into the public domain.\n\u003e\n\u003eAnyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.\n\nDo what you want. Learn as much as you can. Unlicense more software.\n\n[unlicense]: http://unlicense.org/\n[vim-plug]: https://github.com/junegunn/vim-plug\n[vim-javascript]: https://github.com/pangloss/vim-javascript\n[Oliver Caldwell]: http://oli.me.uk/\n[@OliverCaldwell]: https://twitter.com/OliverCaldwell\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folical%2Fvim-syntax-expand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folical%2Fvim-syntax-expand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folical%2Fvim-syntax-expand/lists"}