{"id":15391059,"url":"https://github.com/quramy/vim-js-pretty-template","last_synced_at":"2025-04-13T18:15:09.433Z","repository":{"id":34926867,"uuid":"38988406","full_name":"Quramy/vim-js-pretty-template","owner":"Quramy","description":"highlights JavaScript's Template Strings in other FileType syntax rule","archived":false,"fork":false,"pushed_at":"2021-07-13T18:00:17.000Z","size":115,"stargazers_count":143,"open_issues_count":13,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T18:15:04.040Z","etag":null,"topics":["coffeescript","dart","javascript","syntax-highlighting","typescript","vim"],"latest_commit_sha":null,"homepage":"http://www.vim.org/scripts/script.php?script_id=5222","language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"aploium/zmirror","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Quramy.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}},"created_at":"2015-07-13T03:00:10.000Z","updated_at":"2025-02-04T20:35:54.000Z","dependencies_parsed_at":"2022-08-03T23:15:34.956Z","dependency_job_id":null,"html_url":"https://github.com/Quramy/vim-js-pretty-template","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quramy%2Fvim-js-pretty-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quramy%2Fvim-js-pretty-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quramy%2Fvim-js-pretty-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quramy%2Fvim-js-pretty-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Quramy","download_url":"https://codeload.github.com/Quramy/vim-js-pretty-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248758418,"owners_count":21156957,"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":["coffeescript","dart","javascript","syntax-highlighting","typescript","vim"],"created_at":"2024-10-01T15:09:49.584Z","updated_at":"2025-04-13T18:15:09.408Z","avatar_url":"https://github.com/Quramy.png","language":"Vim script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vim-js-pretty-template\n\nA Vim plugin to highlight JavaScript's [Template Strings](http://tc39wiki.calculist.org/es6/template-strings/) contents in other `FileType` syntax rule which you want.\n\n```js\nvar htmlTempl = `\n\u003cdiv class=\"row\"\u003e\n  \u003cdiv class=\"col-md-12\"\u003e\n    \u003cspan\u003e{{ctrl.message}}\u003c/span\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n`;\n```\n\n![capture](screencast01.gif)\n\nTemplate Strings is available with [Babel](https://babeljs.io/), [google/traceur-compile](https://github.com/google/traceur-compiler) and [TypeScript](http://www.typescriptlang.org/).\n\n## How to install\n\n## Vim 8 native plugins\n\nReplace \"FOOBAR\" with any directory name that you like:\n\n```\n$ mkdir -p ~/.vim/pack/FOOBAR/start/\n$ git clone https://github.com/Quramy/vim-js-pretty-template.git ~/.vim/pack/FOOBAR/start/vim-js-pretty-template\n```\n\n### Vundle\n\nPlace this in your `.vimrc`:\n\n```vim\nPlugin 'Quramy/vim-js-pretty-template'\n```\n\nthen run the following in Vim:\n\n```vim\n:source %\n:PluginInstall\n```\n\n### NeoBundle\n\n```vim\nNeoBundle 'Quramy/vim-js-pretty-template'\n```\n\nthen run the following in Vim:\n\n```vim\n:source %\n:NeoBundleInstall\n```\n\n### Pathogen\nRun the following in a terminal:\n\n```sh\ngit clone https://github.com/Quramy/vim-js-pretty-template.git ~/.vim/bundle/vim-js-pretty-template\n```\n\n## Usage\n\n### Tagged Template Literal\nSet the highlighting of template strings with the  `jspretmpl#register_tag()` function. For example,\n\n```vim\n\" Register tag name associated the filetype\ncall jspretmpl#register_tag('gql', 'graphql')\n\nautocmd FileType javascript JsPreTmpl\nautocmd FileType javascript.jsx JsPreTmpl\n```\n\nThen your JavaScript codes are Highlighted as the following:\n\n```javascript\n// GraphQL way if gql tagged\nconst query = gql`\n  fragment on User {\n    name\n  }\n`;\n```\n\n### For alternative JavaScript users\n\nvim-js-pretty-template is also compatible for TypeScript, Dart and CoffeeScript.\n\n* TypeScript\n* Dart\n* CoffeeScript\n\nFor example:\n\n```vim\nautocmd FileType typescript JsPreTmpl\nautocmd FileType typescript syn clear foldBraces \" For leafgarland/typescript-vim users only. Please see #1 for details.\n```\n\nthen the following template string is highlighted:\n\n```typescript\nvar tmpl: string = `\n## Title\n*Highlighted in Markdown way.*\n`;\n```\n\nor for example:\n\n```vim\nautocmd FileType dart JsPreTmpl\n```\n\nthen:\n\n```dart\nvar tmpl = \"\"\"\n\u003c!-- highlighted in XML way --\u003e\n\u003csvg:svg xmlns:svg=\"http://www.w3.org/2000/svg\"\u003e\n  \u003csvg:circle cx=\"100\" cy=\"100\" r=\"50\"\u003e\u003c/svg:circle\u003e\n\u003c/svg:svg\u003e\n\"\"\";\n```\n\n## License\nThis plugin is released under the MIT license, see `LICENSE.txt`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquramy%2Fvim-js-pretty-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquramy%2Fvim-js-pretty-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquramy%2Fvim-js-pretty-template/lists"}