All Projects β†’ Quramy β†’ Vim Js Pretty Template

Quramy / Vim Js Pretty Template

Licence: mit
highlights JavaScript's Template Strings in other FileType syntax rule

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
dart
5743 projects
coffeescript
4710 projects

Projects that are alternatives of or similar to Vim Js Pretty Template

Vim Js
πŸ’―The most accurate syntax highlighting plugin for JavaScript and Flow.js
Stars: ✭ 99 (-26.67%)
Mutual labels:  syntax-highlighting
Babel Plugin Prismjs
A babel plugin to use PrismJS with standard bundlers.
Stars: ✭ 114 (-15.56%)
Mutual labels:  syntax-highlighting
Yowish.vim
A dark & yellowish vim colorscheme
Stars: ✭ 125 (-7.41%)
Mutual labels:  syntax-highlighting
Delphi Preview Handler
Preview handler for multiple source code extensions
Stars: ✭ 103 (-23.7%)
Mutual labels:  syntax-highlighting
Rdf.sh
A multi-tool shell script for doing Semantic Web jobs on the command line.
Stars: ✭ 109 (-19.26%)
Mutual labels:  syntax-highlighting
Inspiredgithub.tmtheme
A color scheme for Sublime Text 3.
Stars: ✭ 117 (-13.33%)
Mutual labels:  syntax-highlighting
Pythonimproved
The best Python language definition for Sublime Text - ever. Includes full support for Unicode, as well as both Python 2 and Python 3 syntax. Check out the Neon Color Scheme for highlighting.
Stars: ✭ 95 (-29.63%)
Mutual labels:  syntax-highlighting
Diff2html
Pretty diff to html javascript library (diff2html)
Stars: ✭ 1,867 (+1282.96%)
Mutual labels:  syntax-highlighting
Nord Sublime Text
An arctic, north-bluish clean and elegant Sublime Text theme.
Stars: ✭ 109 (-19.26%)
Mutual labels:  syntax-highlighting
Jquery Syntaxhighlighter
jQuery Extension for Google's Prettify Syntax Highlighter
Stars: ✭ 123 (-8.89%)
Mutual labels:  syntax-highlighting
Syntax Highlighting
collection of syntax highlighting colorschemes
Stars: ✭ 105 (-22.22%)
Mutual labels:  syntax-highlighting
Splash
A fast, lightweight and flexible Swift syntax highlighter for blogs, tools and fun!
Stars: ✭ 1,529 (+1032.59%)
Mutual labels:  syntax-highlighting
Ldt
Lightweight in browser syntax highlighting
Stars: ✭ 116 (-14.07%)
Mutual labels:  syntax-highlighting
Mycli
A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.
Stars: ✭ 10,059 (+7351.11%)
Mutual labels:  syntax-highlighting
Jquery Syntax
jQuery.Syntax is a light-weight client-side syntax highlighter.
Stars: ✭ 129 (-4.44%)
Mutual labels:  syntax-highlighting
Litecli
CLI for SQLite Databases with auto-completion and syntax highlighting
Stars: ✭ 1,334 (+888.15%)
Mutual labels:  syntax-highlighting
I3config.vim
Vim syntax highlighting for i3 config πŸ‘ˆ
Stars: ✭ 116 (-14.07%)
Mutual labels:  syntax-highlighting
Zsh Syntax Highlighting Filetypes
zsh syntax highlighting with dircolors in realtime
Stars: ✭ 130 (-3.7%)
Mutual labels:  syntax-highlighting
Nord Vim
An arctic, north-bluish clean and elegant Vim theme.
Stars: ✭ 1,987 (+1371.85%)
Mutual labels:  syntax-highlighting
Vim Gdscript3
Syntax highlighting and completion for GDScript 3
Stars: ✭ 121 (-10.37%)
Mutual labels:  syntax-highlighting

vim-js-pretty-template

A Vim plugin to highlight JavaScript's Template Strings contents in other FileType syntax rule which you want.

var htmlTempl = `
<div class="row">
  <div class="col-md-12">
    <span>{{ctrl.message}}</span>
  </div>
</div>
`;

capture

Template Strings is available with Babel, google/traceur-compile and TypeScript.

How to install

Vim 8 native plugins

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-template

Vundle

Place this in your .vimrc:

Plugin 'Quramy/vim-js-pretty-template'

then run the following in Vim:

:source %
:PluginInstall

NeoBundle

NeoBundle 'Quramy/vim-js-pretty-template'

then run the following in Vim:

:source %
:NeoBundleInstall

Pathogen

Run the following in a terminal:

git clone https://github.com/Quramy/vim-js-pretty-template.git ~/.vim/bundle/vim-js-pretty-template

Usage

Tagged Template Literal

Set the highlighting of template strings with the jspretmpl#register_tag() function. For example,

" Register tag name associated the filetype
call jspretmpl#register_tag('gql', 'graphql')

autocmd FileType javascript JsPreTmpl
autocmd FileType javascript.jsx JsPreTmpl

Then your JavaScript codes are Highlighted as the following:

// GraphQL way if gql tagged
const query = gql`
  fragment on User {
    name
  }
`;

For alternative JavaScript users

vim-js-pretty-template is also compatible for TypeScript, Dart and CoffeeScript.

  • TypeScript
  • Dart
  • CoffeeScript

For example:

autocmd FileType typescript JsPreTmpl
autocmd FileType typescript syn clear foldBraces " For leafgarland/typescript-vim users only. Please see #1 for details.

then the following template string is highlighted:

var tmpl: string = `
## Title
*Highlighted in Markdown way.*
`;

or for example:

autocmd FileType dart 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>
""";

License

This plugin is released under the MIT license, see LICENSE.txt.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].