- Notifications
You must be signed in to change notification settings - Fork11
highlights JavaScript's Template Strings in other FileType syntax rule
License
Quramy/vim-js-pretty-template
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A Vim plugin to highlight JavaScript'sTemplate Strings contents in otherFileType syntax rule which you want.
varhtmlTempl=`<div> <div> <span>{{ctrl.message}}</span> </div></div>`;
Template Strings is available withBabel,google/traceur-compile andTypeScript.
Replace "FOOBAR" with any directory name that you like:
$ mkdir -p ~/.vim/pack/FOOBAR/start/$ git clone https://github.com/Quramy/vim-js-pretty-template.git ~/.vim/pack/FOOBAR/start/vim-js-pretty-templatePlace this in your.vimrc:
Plugin'Quramy/vim-js-pretty-template'
then run the following in Vim:
:source%:PluginInstall
NeoBundle'Quramy/vim-js-pretty-template'then run the following in Vim:
:source%:NeoBundleInstall
Run the following in a terminal:
git clone https://github.com/Quramy/vim-js-pretty-template.git~/.vim/bundle/vim-js-pretty-templateSet the highlighting of template strings with thejspretmpl#register_tag() function. For example,
" Register tag name associated the filetypecalljspretmpl#register_tag('gql','graphql')autocmdFileTypejavascript JsPreTmplautocmdFileTypejavascript.jsx JsPreTmpl
Then your JavaScript codes are Highlighted as the following:
// GraphQL way if gql taggedconstquery=gql` fragment on User { name }`;
vim-js-pretty-template is also compatible for TypeScript, Dart and CoffeeScript.
- TypeScript
- Dart
- CoffeeScript
For example:
autocmdFileTypetypescript JsPreTmplautocmdFileTypetypescriptsynclear foldBraces" For leafgarland/typescript-vim users only. Please see #1 for details.
then the following template string is highlighted:
vartmpl:string=`## Title*Highlighted in Markdown way.*`;
or for example:
autocmdFileTypedart JsPreTmpl
then:
var tmpl="""<!-- highlighted in XML way --><svg:svg xmlns:svg="http://www.w3.org/2000/svg"> <svg:circle cx="100" cy="100" r="50"></svg:circle></svg:svg>""";
This plugin is released under the MIT license, seeLICENSE.txt.
About
highlights JavaScript's Template Strings in other FileType syntax rule
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors7
Uh oh!
There was an error while loading.Please reload this page.
