Giter VIP home page Giter VIP logo

tj-mode's Introduction

tj-mode

Highlight JavaScript with Tern.

Features

Syntactic Highlighting

  • Keywords + this
  • Variable declarations and function arguments
  • Function names (incl. variables and object properties)
  • Primitive literals (strings, numbers, booleans etc)
  • Comments (inline and block)

Extra Features ๐Ÿ’ฅ

  • Syntax errors (from strict parser)
  • Undeclared variables
  • Trailing commas in array and object literals
  • Missing semicolons after statements

Emacs Mode

tj-mode is a major mode. Apart from syntax highligting, the mode provides:

  • Syntactic beginning-of-defun and end-of-defun
  • Automatic (idle) highlighting of references to the variable at point

Bouncing indentation is borrowed from the excellent js2-mode.

Other Editors

Contributions of other editor plugins are very welcome.

How to Install

Install like any other Tern plugin. The Tern plugin is called tern-highlight, and it's on on npm, so:

npm install -g tern-highlight

You also need to enable the plugin in your .tern-project files:

{
    "plugins": {
        "highlight": {}
    }
}

How to Install the Emacs Plugin

The Emacs package is not on MELPA yet, so you have to install it manually:

(load "~/.emacs.d/site-lisp/tj-mode.el")
(add-to-list 'auto-mode-alist '("\\.js\\'" . tj-mode))

Tests

TODO

Credits

Some of the code in tokens.js (the part about undefined variables) is taken from tern-lint.

P.S.

This package is not written by TJ Holowaychuk ๐Ÿ˜„

tj-mode's People

Contributors

katspaugh avatar syohex avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.