Git Product home page Git Product logo

vim-es6's People

Contributors

cpitt avatar isruslan avatar jaspax avatar quezak avatar s0ber avatar shuizhongyueming avatar vctr-dev avatar whitelynx 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

vim-es6's Issues

How to enable code folding?

  • I see JavaScriptFold() in the source, however vim tells me No fold found when I type zc in a foldable block
  • If I add the following manually to my ~/.vimrc, it seems to work:
" From vim-es6 source:
setl foldmethod=syntax
setl foldlevelstart=1
syntax region foldBraces start=/{/ end=/}/ transparent fold keepend extend
  • How can I get folding to work without manually adding the above to ~/.vimrc?

Literals are not highlighted nicely in objects

First of all, thank you for this plugin!

I have a suggestion for highlighting in objects. As it stands, everything is purple except non-string keys:

image

The problem becomes especially apparent when the object keys are also strings, as they become the same colour as everything else.

It would be great if the highlighting somehow differentiated between keys, literals (true, false, 10, 4.2), and strings. For example, the default highlighting "solves" this problem by simply ignoring numbers:

image

An even better solution would be greatly appreciated, though.

4MB gif in repo

Hey thanks for writing this, so far it works quite well. I noticed the example gif in your README has been committed directly to git. Since the file is 4MB, it makes cloning the repo a lot slower than it needs to be, particularly over coffee shop wifi. You may want to consider hosting the image somewhere external and just linking to it from the README so it doesn't need to live in source control and bloat the repo.

bracket on new line indents incorrectly

Example:

if (1)
  {
    echo 'foo';
  }

I expect this to indent as:

if (1)
{
  echo 'foo';
}

It appears to handle the bracket inline just fine though:

if (1) {
  echo 'foo';
}

closing paren on newline ruins indent

Example:

let foo = (( 1+
            2)
          )
          let bar = 3;

I would expect this to be:

let foo = (( 1+
            2)
)
let bar = 3;

or this (possible configurable):

let foo = (( 1+
  2)
)
let bar = 3;

Comments -->

It seems comments are not being aded to the HI Comment group?

Example:

// Single Line Slashed Comment
--> Single Line Arrow Comment

I would think these should both be the same color using your plugin?

Nice work BTW! Thanks for the effort. ES6 is definitely a nicer experience with your plugin enabled.

Incorrect highlighting of RegExp literal with / in character class

The grammar for RegExp literals in ES6 allows / to appear without a preceding \ in character class expressions (see RegularExpressionClassChar in the grammar). However, vim-es6 highlights such expressions incorrectly. For example, in the following:

/foo[/]bar/

vim-es6 does not highlight ]bar/ as part of the regular expression.

Note that this is made more significant by the the ESLint no-useless-escape rule (which is enabled by popular configurations such as the airbnb config) which produces a warning when \ is added.

Thanks,
Kevin

Modules path and highlight links are wrong

Hello! I just started using this repository to get syntax highlighting for ES6 features, and I found a couple of issues:

  • The modules include path is syntax/vim-es6/modules/*.vim, but the modules are placed in syntax/modules/ directory.
  • Before doing syntax highlight linking, modules check if exists("did_javascript_hilink"), but this variable isn't set anywhere.
  • The modules use the HiLight function, which is defined in the main syntax file later, thus it's inaccessible by the modules.

I fixed these errors to make things work for me, I'll make a pull request in a minute :)

support JSDoc syntax highlighting

I've installed this plugin without any problem, but when I want to make a comment for JSDoc the syntax highlighting doesn't work.
I don't know if this just happened to me or not?
JSDoc

multi-line if statements indent incorrectly

Example:

  if ((1) ||
      (2) ||
        (3)
     ) {
       echo 'foo';
     }

The above is bad because visually it looks like we're still inside the if statement as the indent has changed.

It's also a little messed up in the case of the ) { inline on the third line:

if ((1) ||
    (2) ||
      (3)) {
  echo 'foo';
}

but it gets worse with two lines inside the if:

if (1 ||
    2 ||
      3) {
  echo 'foo';
echo 'bar';
}

and finally, with the bracket on a new line:

if ((1) ||
    (2) ||
      (3))
  {
    echo 'foo';
  }

I would expect these to indent as so:

if ((1) ||
    (2) ||
    (3)
) {
  echo 'foo';
}

if ((1) ||
    (2) ||
    (3)) {
  echo 'foo';
}

if (1 ||
    2 ||
    3) {
  echo 'foo';
  echo 'bar';
}

if ((1) ||
    (2) ||
      (3))
{
  echo 'foo';
}

or like this (possibly configurable):

if ((1) ||
  (2) ||
  (3)
) {
  echo 'foo';
}

if ((1) ||
  (2) ||
  (3)) {
  echo 'foo';
}

if (1 ||
  2 ||
  3) {
  echo 'foo';
  echo 'bar';
}

if ((1) ||
  (2) ||
  (3))
{
  echo 'foo';
}

String highlights stopped working

First off, thanks for the great plugin! I'm new to vim so i'm not much help looking into issues yet, but I just pulled the latest commit and it appears to break string highlighting on all my import statements.

For example, with import logger from '../util/logger'; the path string used to be highlighted green for me, but now it looks just like plain text. I've reverted back to the previous commit and it works fine again.

Any ideas? Thanks!

Does not handle multi-line method chaining indent properly

This package handles multi-line method indent like this:

const foo = this.someMethod()
.someOtherMethod();

But it should handle it like this (or at least provide the option to handle it this way):

const foo = this.someMethod()
  .someOtherMethod();

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.