ctrl+shift+p filters: :st2 :st3 :win :osx :linux
浏览

Python 导入魔法

alecthomas ST2

这个 Sublime Text 2 插件试图自动管理 Python 导入。

->详细信息

  • 2016.03.16.23.30.19
  • github.com
  • github.com
  • 8年前
  • 43分钟前
  • 10年前

安装次数

  • 总计 2K
  • Win 749
  • Mac 559
  • Linux 455
8月6日 8月5日 8月4日 8月3日 8月2日 8月1日 7月31日 7月30日 7月29日 7月28日 7月27日 7月26日 7月25日 7月24日 7月23日 7月22日 7月21日 7月20日 7月19日 7月18日 7月17日 7月16日 7月15日 7月14日 7月13日 7月12日 7月11日 7月10日 7月9日 7月8日 7月7日 7月6日 7月5日 7月4日 7月3日 7月2日 7月1日 6月30日 6月29日 6月28日 6月27日 6月26日 6月25日 6月24日 6月23日
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
012348月6日8月3日7月31日7月28日7月25日7月22日7月19日7月16日7月13日7月10日7月7日7月4日7月1日6月28日6月25日8月6日 Linux: 0 Mac: 0 Windows: 08月5日 Linux: 0 Mac: 0 Windows: 08月4日 Linux: 0 Mac: 0 Windows: 08月3日 Linux: 0 Mac: 0 Windows: 08月2日 Linux: 0 Mac: 0 Windows: 08月1日 Linux: 0 Mac: 0 Windows: 07月31日 Linux: 0 Mac: 0 Windows: 07月30日 Linux: 0 Mac: 0 Windows: 07月29日 Linux: 0 Mac: 0 Windows: 07月28日 Linux: 0 Mac: 0 Windows: 07月27日 Linux: 0 Mac: 0 Windows: 07月26日 Linux: 0 Mac: 0 Windows: 07月25日 Linux: 0 Mac: 0 Windows: 07月24日 Linux: 0 Mac: 0 Windows: 07月23日 Linux: 0 Mac: 0 Windows: 07月22日 Linux: 0 Mac: 0 Windows: 07月21日 Linux: 0 Mac: 0 Windows: 07月20日 Linux: 0 Mac: 0 Windows: 07月19日 Linux: 0 Mac: 0 Windows: 07月18日 Linux: 0 Mac: 0 Windows: 07月17日 Linux: 0 Mac: 0 Windows: 07月16日 Linux: 0 Mac: 0 Windows: 07月15日 Linux: 0 Mac: 0 Windows: 07月14日 Linux: 0 Mac: 0 Windows: 07月13日 Linux: 0 Mac: 0 Windows: 07月12日 Linux: 0 Mac: 0 Windows: 07月11日 Linux: 0 Mac: 0 Windows: 07月10日 Linux: 0 Mac: 0 Windows: 07月9日 Linux: 0 Mac: 0 Windows: 07月8日 Linux: 0 Mac: 0 Windows: 07月7日 Linux: 0 Mac: 0 Windows: 07月6日 Linux: 0 Mac: 0 Windows: 07月5日 Linux: 0 Mac: 0 Windows: 07月4日 Linux: 0 Mac: 0 Windows: 07月3日 Linux: 0 Mac: 0 Windows: 07月2日 Linux: 0 Mac: 0 Windows: 07月1日 Linux: 0 Mac: 0 Windows: 06月30日 Linux: 0 Mac: 0 Windows: 06月29日 Linux: 0 Mac: 0 Windows: 06月28日 Linux: 0 Mac: 0 Windows: 06月27日 Linux: 0 Mac: 0 Windows: 06月26日 Linux: 0 Mac: 0 Windows: 06月25日 Linux: 0 Mac: 0 Windows: 06月24日 Linux: 0 Mac: 0 Windows: 06月23日 Linux: 0 Mac: 0 Windows: 08月6日 Linux: 0 Mac: 0 Windows: 08月5日 Linux: 0 Mac: 0 Windows: 08月4日 Linux: 0 Mac: 0 Windows: 08月3日 Linux: 0 Mac: 0 Windows: 08月2日 Linux: 0 Mac: 0 Windows: 08月1日 Linux: 0 Mac: 0 Windows: 07月31日 Linux: 0 Mac: 0 Windows: 07月30日 Linux: 0 Mac: 0 Windows: 07月29日 Linux: 0 Mac: 0 Windows: 07月28日 Linux: 0 Mac: 0 Windows: 07月27日 Linux: 0 Mac: 0 Windows: 07月26日 Linux: 0 Mac: 0 Windows: 07月25日 Linux: 0 Mac: 0 Windows: 07月24日 Linux: 0 Mac: 0 Windows: 07月23日 Linux: 0 Mac: 0 Windows: 07月22日 Linux: 0 Mac: 0 Windows: 07月21日 Linux: 0 Mac: 0 Windows: 07月20日 Linux: 0 Mac: 0 Windows: 07月19日 Linux: 0 Mac: 0 Windows: 07月18日 Linux: 0 Mac: 0 Windows: 07月17日 Linux: 0 Mac: 0 Windows: 07月16日 Linux: 0 Mac: 0 Windows: 07月15日 Linux: 0 Mac: 0 Windows: 07月14日 Linux: 0 Mac: 0 Windows: 07月13日 Linux: 0 Mac: 0 Windows: 07月12日 Linux: 0 Mac: 0 Windows: 07月11日 Linux: 0 Mac: 0 Windows: 07月10日 Linux: 0 Mac: 0 Windows: 07月9日 Linux: 0 Mac: 0 Windows: 07月8日 Linux: 0 Mac: 0 Windows: 07月7日 Linux: 0 Mac: 0 Windows: 07月6日 Linux: 0 Mac: 0 Windows: 07月5日 Linux: 0 Mac: 0 Windows: 07月4日 Linux: 0 Mac: 0 Windows: 07月3日 Linux: 0 Mac: 0 Windows: 07月2日 Linux: 0 Mac: 0 Windows: 07月1日 Linux: 0 Mac: 0 Windows: 06月30日 Linux: 0 Mac: 0 Windows: 06月29日 Linux: 0 Mac: 0 Windows: 06月28日 Linux: 0 Mac: 0 Windows: 06月27日 Linux: 0 Mac: 0 Windows: 06月26日 Linux: 0 Mac: 0 Windows: 06月25日 Linux: 0 Mac: 0 Windows: 06月24日 Linux: 0 Mac: 0 Windows: 06月23日 Linux: 0 Mac: 0 Windows: 08月6日 Linux: 0 Mac: 0 Windows: 08月5日 Linux: 0 Mac: 0 Windows: 08月4日 Linux: 0 Mac: 0 Windows: 08月3日 Linux: 0 Mac: 0 Windows: 08月2日 Linux: 0 Mac: 0 Windows: 08月1日 Linux: 0 Mac: 0 Windows: 07月31日 Linux: 0 Mac: 0 Windows: 07月30日 Linux: 0 Mac: 0 Windows: 07月29日 Linux: 0 Mac: 0 Windows: 07月28日 Linux: 0 Mac: 0 Windows: 07月27日 Linux: 0 Mac: 0 Windows: 07月26日 Linux: 0 Mac: 0 Windows: 07月25日 Linux: 0 Mac: 0 Windows: 07月24日 Linux: 0 Mac: 0 Windows: 07月23日 Linux: 0 Mac: 0 Windows: 07月22日 Linux: 0 Mac: 0 Windows: 07月21日 Linux: 0 Mac: 0 Windows: 07月20日 Linux: 0 Mac: 0 Windows: 07月19日 Linux: 0 Mac: 0 Windows: 07月18日 Linux: 0 Mac: 0 Windows: 07月17日 Linux: 0 Mac: 0 Windows: 07月16日 Linux: 0 Mac: 0 Windows: 07月15日 Linux: 0 Mac: 0 Windows: 07月14日 Linux: 0 Mac: 0 Windows: 07月13日 Linux: 0 Mac: 0 Windows: 07月12日 Linux: 0 Mac: 0 Windows: 07月11日 Linux: 0 Mac: 0 Windows: 07月10日 Linux: 0 Mac: 0 Windows: 07月9日 Linux: 0 Mac: 0 Windows: 07月8日 Linux: 0 Mac: 0 Windows: 07月7日 Linux: 0 Mac: 0 Windows: 07月6日 Linux: 0 Mac: 0 Windows: 07月5日 Linux: 0 Mac: 0 Windows: 07月4日 Linux: 0 Mac: 0 Windows: 07月3日 Linux: 0 Mac: 0 Windows: 07月2日 Linux: 0 Mac: 0 Windows: 07月1日 Linux: 0 Mac: 0 Windows: 06月30日 Linux: 0 Mac: 0 Windows: 06月29日 Linux: 0 Mac: 0 Windows: 06月28日 Linux: 0 Mac: 0 Windows: 06月27日 Linux: 0 Mac: 0 Windows: 06月26日 Linux: 0 Mac: 0 Windows: 06月25日 Linux: 0 Mac: 0 Windows: 06月24日 Linux: 0 Mac: 0 Windows: 06月23日 Linux: 0 Mac: 0 Windows: 0

自述文件

源代码
raw.​githubusercontent.​com

Sublime Text 3 - Python 导入魔法

此插件试图自动管理 Python 导入。

警告:这是一个相对复杂的插件,因此可能包含错误。它可能删除你需要的导入。它可能会添加你不需要的导入。使用风险自负。

它可以

  • 检测并为未知符号添加导入。
  • 删除未使用导入。
  • 按照 PEP8 排序导入。

目前不能(但计划支持)

  • 检测文件变更并自动更新索引。当前的方法是使用命令面板的 Python Import Magic: 重置索引 命令。

示例

使用方法

有三种方法可以调用自动导入器

  • 快捷键:OSX 上的 ⌘⇧I,Windows 和 Linux 上的 ^⇧I
  • 通过命令面板: Python Import Magic: 更新导入
  • 在包的用户设置中将其 update_imports_on_save 设置为 true我目前不鼓励使用此设置,但如果您特别勇敢……

配置

例如:

{
    "update_imports_on_save": true,
    "python_path": {
        "/Library/Python/2.7/site-packages": "S",
        "/Users/alec/Projects/SublimePythonImportMagic/.venv/lib/python2.7/site-packages": "L"
    }
}

update_imports_on_save = false

如果为真,则在每次保存时更新导入。警告:这可能不是一个好主意。

index_filename = ".importmagic.idx"

存储索引的文件名。

python_path = {<path>: <classification>}

注:尚未实现

键是搜索 Python 模块的路径。值是将路径如何分类。

路径还将根据默认 Sublime 配置在 python_import_magic_python_path 键下进行查找。

<classification> 来自以下表

分类
3 第三方
S 系统
L 本地