Installing TernJS plugin for Sublime Text – the laziest way

  • Step 1 – Install Package Control (if installed skip to step 3)press:
    ctrl + ` (ctrl backtick)

    to open the console

  • Step 2 – Paste the following code on the console and restart Sublime
    import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print('Please restart Sublime Text to finish installation')
  • Step 3 – open the Package control
    Ctrl + Shift + P
  • Step 4 – update Package control
    install

    install

  • Step 5 – install Sublime TernJS plugin
    TernJS

    ternjs-install

Done!

Last thing is to set-up the TernJS plugin commands short-keys

keys

Sublime TernJS plugin will provide JavaScript Inference for the files on your Sublime Poject.

infering-require

infering-jquery

go-to-definition

testing demo  source

References:

TernJS
is a JavaScript inference enging developed by Marijn Haverbeke,
and the TernJS plugin for sublime is been developed by Sergey Chikuyonok from emmet.io

Both the engine and the plugin are still on an early beta, there will be an official TernJS plugin for Vim and SublimeText 2.

Advertisement

2 thoughts on “Installing TernJS plugin for Sublime Text – the laziest way

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s