Sublime Text 2 & 3 setup for python / django with

2019-01-16 05:05发布

问题:

I want to use an autocomplete plugin with sublime text for web development. I'm using django framework. I've looked into the following possible options. Not really a question, just for reference, I've added these here.


The listing order represents popularity to a certain extent (based on activity level, commits, contributors, favorties, forks, issues (open/closed) [Feb-2014]


  • SublimeCodeIntel : Code intelligence plugin ported from Open Komodo Editor to Sublime Text.

    Features :

    • Jump to Symbol Definition - Jump to the file and line of the definition of a symbol
    • Imports autocomplete - Shows autocomplete with the available modules/symbols in real time
    • Function Call tooltips - Displays information in the status bar about the working function
    • Supports : JavaScript, Mason, XBL, XUL, RHTML, SCSS, Python, HTML, Ruby, Python3, XML, Sass, XSLT, Django, HTML5, Perl, CSS, Twig, Less, Smarty, Node.js, Tcl, TemplateToolkit, PHP.

  • SublimeJEDI : SublimeJEDI is a Sublime Text 2 and Sublime Text 3 plugin to the awesome autocomplete library Jedi

    Features:

    • Autocomplete on DOT
    • Function args fill up on completion
    • Jedi Goto / Go Definition
    • Jedi Find Related Names ("Find Usages")

  • Djaneiro : Django support for Sublime Text 2/3

    Features

    • Snippets for Django templates
    • Snippets for Django model fields
    • Snippets for Django form fields
    • Completions

  • SublimeRope : No recent activity. Last commit Dec 21, 2013. ST2 only, use SublimePythonIDE with ST3: Adds Python completions and some IDE-like functions to Sublime Text 2, through the use of the Rope library

    Features :

    • See details here : http://rope.sourceforge.net/

回答1:

In my opinion, there are ONLY 2 sulbime plugins that provide really good completion:

  • SublimeJEDI for ST2 and ST3
  • Anaconda for ST3

CodeIntel and Rope works badly. Djaneiro is more snippets than completion but I also find it useful.



回答2:

I've been using SublimeJEDI for some time. It does the job to a certain extent without adding bloat. It has limitations and it's far from being as aesthetic and complete as PyCharm.

With new editors supporting code completion out of the box, I'm dismayed that ST doesn't do a good job at it.

Update : After using it for a few months, I feel SublimeJEDI doesn't really add much convenience. It rather messes some of the default completions of ST2 when you cycle through various options with Tab. It's prediction is severely broken.



回答3:

I found the Djaneiro plugin super useful. It adds syntax highlighting for Django HTML templates and comes with a bunch of handy code completion snippets:

For example, you can type if, hit Tab, and Djaneiro creates a complete {% if ___ %} {% endif %} block for you automatically.

I guess it depends on one's definition of "auto-complete" but I really like the snippets added by Djaneiro. I use it in combination with the Anaconda plugin for code completion and I'm very happy with this setup for Django development.

I actually wrote a review of Djaneiro and its features a while ago. You can find it here if you're interested: https://dbader.org/blog/sublime-text-djaneiro-review