Git Product home page Git Product logo

vue-syntax-highlight's Introduction

Vue Syntax Highlight

Note: The master branch hosts the tmLanguage based implementation that is distributed to Sublime Text build < 3153. It is also used to power GitHub's syntax highlight of *.vue files in linguist.

For a newer implementation of the syntax that is distributed to build >=3153, See the new branch.


Sublime Text Syntax highlighting for single-file Vue.js components (enabled by vue-loader or vueify).

screenshot

Install

  • Via Package Control: search for Vue Syntax Highlight.
  • Manual: clone this repo into your Sublime Packages folder.

Additional Installation Requirements: In order to get proper syntax highlighting for pre-processors (e.g. Jade, SASS, CoffeeScript) you will also need to install the corresponding packages for each of them.

Enabling JSX Highlighting

The <script> block uses the syntax highlighting currently active for you normal .js files. To support JSX highlighting inside Vue files, just set Babel javascript highlighting package, which supports JSX, as your default JS highlighting. Note you may need to explicitly disable Sublime's default JavaScript package to make it work.

License

MIT

vue-syntax-highlight's People

Contributors

aleph1 avatar azamat-sharapov avatar benjcal avatar braver avatar dezeter avatar gcaufy avatar georgesg avatar ilearnio avatar jpokrzyk avatar kazupon avatar lauigi avatar louim avatar luke-j avatar mationai avatar skyronic avatar taylorzane avatar wopian avatar wszgxa avatar xgvargas avatar yuchuanxi avatar yyx990803 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-syntax-highlight's Issues

Not working at all in 3114

Not sure if I'm missing a component, but this is not working at all for me. Could it be a problem with the latest version of Sublime? There seem to also be some problems rendering jade blocks in Markdown Extended too; though scss still works fine there

untitled

lang=scss

im use Syntax-highlighting-for-Sass but no highlight no tab key support

this is fix case:
L340 source.scss.embedded.html
L364 source.scss

// Emmet.sublime-settings L53
"disabled_single_snippet_for_scopes": ""

New php files being set to Vue Component syntax

When creating a new php file in Sublime (Build 3103), if php content is pasted into the file before any other content is created, the file automatically gets it's syntax set to Vue Component, which is obviously incorrect since it's not a .vue file.

While I've only played with creating syntax files in sublime, I'm pretty sure this is due to these lines here: https://github.com/vuejs/vue-syntax-highlight/blob/master/vue.tmLanguage#L9-L10 which are looking at the first line to see if it's doctype, html or php tags. I'm unsure why this is included in the syntax file since none of those three are tags that would represent a .vue component file.

for in coffeescript highlight

proper coffee highlight http://i65.tinypic.com/k03p0o_th.png

<template>
</template>

<script lang='iced'>

module.exports =
  data : ()->
    for some in stuff
      do_something
    list = []
</script>

<style>
</style>

transforms to : http://i63.tinypic.com/35ldlqs_th.png
Not all lines after including style are broken.
This partially cures highlight

<template>
</template>

<script lang='iced'>

module.exports =
  data : ()->
    for some in stuff
      # )
      do_something
    list = []
</script>

<style>
</style>

Result: http://i68.tinypic.com/2di4wb4_th.png

Also comments and heredoc rendered wrongly.

Sublime build 3103
Better CoffeeScript plugin used. v2014.12.2819.15.55
Vue Syntax Highlight v2.1.3

Error highlighting on multiple cases in v-if

I've noticed that Sublime highlights && as if there is an error when you are putting multiple conditions in a v-if statement... is this a bug or are we not supposed to use this in Vue?

screen shot 2016-04-07 at 21 53 32

Weird behavior when using class

When using the word class inside templates attributes, this happens:

screenshot_1

And the highlighter handles the script content as if it is a template content.

setting: scss mode

screen shot 2016-01-31 at 16 55 23

when using <style lang="sass"> would be awesome if 'scss' could be specified as syntax.

ES6 syntax incorrect highlight

let and strings in back-ticks aren't highlighted properly:

2771215460

Sublime Text 3 build 3114
vue-syntax-highlight is up to date

Comments in script

If you try to comment in script it gives you comment for template.

_Tested on: Sublime Text 3114_

out

_edit_
Problem occured when "Laravel Blade Highlighter" package is enabled.

lang="coffee" or lang="coffeescript"?

lang="coffee" won't set syntax highlighting, while lang="coffeescript"will raise an error Module not found: Error: Cannot resolve module 'coffeescript'. So would there add lang="coffee" support?

Jade syntax highlighting

Jade syntax highlighting on .vue files stopped working, a day ago. After some digging, I found out, that this commit from davidrios/jade-tmbundle is causing this issue. As I workaround, I've cloned that jade package manually and reverted to that commit. .jade files are fine though.

Using Sublime 3 (3083) on Ubuntu 14.04.

Better support ES6 Syntax

This is something Sublime itself is lacking, and plugins such as JavaScript Next and Babel fix.

For instance the new method declaration is treated as a method call.

  1. entity.name.function,js
    function doStuff() {
    }

  2. meta.function-call.js
    var ob = {
    doStuff() {
    }
    }

In Next, they're called entity.name.method.js and entity.name.function.js

source.scss

hello Evan
I have SCSS package installed in my sublime text.
The hightlight only worked when I changed the line 298 of vue.tmLanguage to <string>source.scss</string>
Best,
Marlus

No syntax highlighting for single quote lang='' blocks

Opening this here as this is the grammar used by GitHub's Linguist for Vue syntax highlighting on GitHub.

Using single quotes, Jade/Pug doesn't highlight at all and SCSS @extend and variables behave strangely as it uses the CSS grammar:

<template lang='jade'>
div
  if hello
    p Hello
    else
      p World
</template>

<style lang='scss'>
  @import '~styles/main.scss';
  section[role='alert'] {
    @extend .alert;
    background: $white;
  }
</style>

Using double quotes they are fine:

<template lang="jade">
div
  if hello
    p Hello
    else
      p World
</template>

<style lang="scss">
  @import '~styles/main.scss';
  section[role='alert'] {
    @extend .alert;
    background: $white;
  }
</style>

请教:在sublime 3中,es6高亮问题

因为sublime 3默认的js语法高亮好像对es6支持的不太好,比如
export default {
data () {
//.........
}
}
这里的 data 是白色的没有颜色)

我的sulime安装了babel插件,单独的js文件,可以切换到 Javascript(babel),但当写Vue Component时,只能用默认的高亮,这时 data JSON Array等都是无颜色的。怎么解决呢?

谢谢

Sublime Text Auto-closing Tags

When using Sublime Text (dev 3102) and the vue-syntax-highlight library, auto-closing a tag with string interpolation causes Sublime Text to use the wrong closing tag.

Example:

<template>
  <div id="foo">{{ test }}
</template>

When adding </ after {{ test }}, the following occurs.

<template>
  <div id="foo">{{ test }}</{>
</template>

I would imagine this is a bug with ST3's auto-closing feature, but it's possible it's a bug with the syntax definition, so I'm posting this here.

Anything following jade loses syntax

There is a small bug in the syntax highlighting when using jade templates

Anything following the close of the template tag has incorrect or inconsistent colors, eg:

<!-- template -->
<template lang="jade">
...
</template>

<style lang="stylus">
@import '../shared'
.complete 
    text-decoration line-through
</style>

... offers different stylus syntax highlighting than: note the @import statement

<!-- template -->
<template>
...
</template>

<style lang="stylus">
@import '../shared'
.complete 
    text-decoration line-through
</style>

of course this is with stylus and jade syntax highlighting installed in ST3

screen shot 2015-07-24 at 5 12 24 pm
screen shot 2015-07-24 at 5 12 33 pm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.