带有代码完成功能的 python/django Sublime Text 2 & 3 设置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18914386/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Sublime Text 2 & 3 setup for python / django with code completion
提问by user
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.
我想使用带有 sublime 文本的自动完成插件进行 Web 开发。我正在使用 Django 框架。我研究了以下可能的选项。不是真正的问题,仅供参考,我在这里添加了这些。
The listing order represents popularity to a certain extent (based on activity level, commits, contributors, favorties, forks, issues (open/closed) [Feb-2014]
列表顺序在一定程度上代表了受欢迎程度(基于活动水平、提交、贡献者、收藏夹、分叉、问题(开放/关闭)[2014 年 2 月]
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.
SublimeCodeIntel:从 Open Komodo Editor 移植到 Sublime Text 的代码智能插件。
特征 :
- 跳转到符号定义 - 跳转到符号定义的文件和行
- 导入自动完成 - 实时显示可用模块/符号的自动完成
- 函数调用工具提示 - 在状态栏中显示有关工作函数的信息
- 支持: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")
SublimeJEDI:SublimeJEDI 是一个 Sublime Text 2 和 Sublime Text 3 插件,用于强大的自动完成库 Jedi
特征:
- DOT 上的自动完成
- 函数参数在完成时填满
- Jedi Goto / Go 定义
- 绝地查找相关名称(“查找用法”)
Djaneiro: Django support for Sublime Text 2/3
Features
- Snippets for Django templates
- Snippets for Django model fields
- Snippets for Django form fields
- Completions
Djaneiro:Django 支持 Sublime Text 2/3
特征
- Django 模板的片段
- Django 模型字段的片段
- Django 表单字段的片段
- 完成
SublimeRope: No recent activity. Last commit Dec 21, 2013.
ST2 only, use SublimePythonIDEwith ST3: Adds Python completions and some IDE-like functions to Sublime Text 2, through the use of the Rope libraryFeatures :
- See details here : http://rope.sourceforge.net/
SublimeRope:最近没有活动。上次提交时间为 2013 年 12 月 21 日。
仅 ST2,将SublimePythonIDE与 ST3结合使用:通过使用 Rope 库,将 Python 完成和一些类似 IDE 的函数添加到 Sublime Text 2特征 :
- 在此处查看详细信息:http: //rope.sourceforge.net/
采纳答案by WebPal
In my opinion, there are ONLY 2 sulbime plugins that provide really good completion:
在我看来,只有 2 个 sulbime 插件可以提供非常好的补全:
- SublimeJEDIfor ST2 and ST3
- Anacondafor ST3
- 用于 ST2 和 ST3 的SublimeJEDI
- ST3 的蟒蛇
CodeIntel and Rope works badly. Djaneiro is more snippets than completion but I also find it useful.
CodeIntel 和 Rope 效果不佳。Djaneiro 是更多的片段而不是完成,但我也发现它很有用。
回答by user
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.
我一直在使用 SublimeJEDI 一段时间。它在一定程度上完成了这项工作,而不会增加膨胀。它有局限性,远没有 PyCharm 那样美观和完整。
With new editors supporting code completion out of the box, I'm dismayed that ST doesn't do a good job at it.
随着新的编辑器支持开箱即用的代码完成,我对 ST 没有做好这方面的工作感到失望。
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.
更新:使用几个月后,感觉SublimeJEDI并没有真正增加多少便利。当您使用Tab. 它的预测被严重破坏。
回答by dbader
I found the Djaneiroplugin super useful. It adds syntax highlighting for Django HTML templates and comes with a bunch of handy code completion snippets:
我发现Djaneiro插件非常有用。它为 Django HTML 模板添加了语法高亮,并附带了一堆方便的代码完成片段:
For example, you can type if
, hit Tab
, and Djaneiro creates a complete {% if ___ %} {% endif %}
block for you automatically.
例如,您可以键入if
、hitTab
和 Djaneiro,然后 Djaneiro 会{% if ___ %} {% endif %}
自动为您创建一个完整的块。
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.
我想这取决于一个人对“自动完成”的定义,但我真的很喜欢 Djaneiro 添加的片段。我将它与 Anaconda 插件结合使用来完成代码,我对 Django 开发的这个设置非常满意。
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?
实际上,我不久前写了一篇关于 Djaneiro 及其功能的评论。如果您有兴趣,可以在这里找到它:https: //dbader.org/blog/sublime-text-djaneiro-review?