Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting full JS autocompletion under Sublime Text

I just installed the Sublime Text under Windows Vista, and even following the advice given in this post, namely to explicitly set View > Syntax > JavaScript > JavaScript, I only see suggestions based on what I have previously typed. I even installed the SublimeCodeIntel plug-in, to no avail.

As I understand it, the moment I write "pars" I should get the "parseFloat" and "parseInt" options, as in the Chrome developer tools, right?

Thanks!

like image 767
ezequiel-garzon Avatar asked Dec 01 '12 16:12

ezequiel-garzon


People also ask

How do I enable auto complete in Sublime Text?

By default, Sublime Text will automatically show the completions popup when a user is editing source code or markup, but not within prose in comments, strings or markups. Pressing the Esc key will hide the completions popup. To manually show the completions popup, press Ctrl+Space.

Does Sublime have IntelliSense?

Sublime has autocompletion already and there's no IntelliSense package.


2 Answers

Suggestions are (basically) based on the text in the current open file and any snippets or completions you have defined (ref). If you want more text suggestions, I'd recommend:

  • Adding your own snippets for commonly used operations.
  • Adding your own completions for common words.
  • Adding other people's snippets through Package Control.
  • You can find even more snippets on github.
  • Use Zen coding (available through Package Control) or Emmet.
  • There are also various packages that adjust the way code completion works. I love SublimeCodeIntel, but check out other answers to this question for more options.

As a side note, I'd really recommend installing Package control to take full advantage of the Sublime community. Some of the options above use Package control. I'd also highly recommend the tutsplus Sublime tutorial videos, which include all sorts of information about improving your efficiency when using Sublime.

like image 86
dbn Avatar answered Sep 28 '22 05:09

dbn


Ternjs is a new alternative for getting JS autocompletion. http://ternjs.net/

Sublime Plugin

The most well-maintained Tern plugin for Sublime Text is called 'tern_for_sublime'

There is also an older plugin called 'TernJS'. It is unmaintained and contains several performance related bugs, that cause Sublime Text to crash, so avoid that.

like image 31
subhaze Avatar answered Sep 28 '22 04:09

subhaze