GithubHelp home page GithubHelp logo

tern's Introduction

Tern

This is Tern. Tern is a stand-alone, editor-independant JavaScript analyzer that can be used to improve the JavaScript integration of existing editors. It currently comes only with an online demo, but I am hard at work on Emacs and Vim plug-ins.

Thanks to a group of generous crowd funders, Tern is open-source software, under an MIT license.

Setting up the Emacs mode

(Disclaimer: This is a work in progress. The interface will change, and it has bugs. But it just might occasionally work.)

  1. Make sure you are using Emacs 24 or later. The Tern mode requires lexical scoping.

  2. Clone this repository somewhere. Do npm install to get the dependencies.

  3. Make Emacs aware of emacs/tern.el. For example by adding this to your .emacs file:

    (add-to-list 'load-path "/path/to/tern/emacs/")
    (autoload 'tern-mode "tern.el" nil t)
    
  4. Optionally set tern-mode to be automatically enabled for your JavaScript mode of choice. Here's the snippet for js-mode:

    (add-hook 'js-mode-hook (lambda () (tern-mode t)))
    

Buffers in tern-mode add a completion-at-point function that activates Tern's completion. So, unless you rebound the command, M-tab will trigger completion.

When the point is in an argument list, Tern will show argument names and types at the bottom of the screen.

The following keys are bound:

  • M-. to jump to the definition of the thing under the cursor.
  • M-, brings you back to last place you were when you pressed M-..
  • C-c C-r to rename the variable under the cursor.

tern's People

Contributors

marijnh avatar sergioramos avatar

Watchers

Robert Dale Schell avatar James Cloos 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.