ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Auto​PEP8

by wistful ST2/ST3

Automatically formats Python code to conform to the PEP 8 style guide using autopep8 and pep8 modules

Details

Installs

  • Total 57K
  • Win 25K
  • OS X 16K
  • Linux 16K
Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6
Windows 12 35 46 33 54 45 49 40 33 49 46 45 48 46 28 36 35 51 47 65 42 32 34 48 56 54 57 52 25 24 48 58 47 60 47 25 33 34 55 58 57 48 40 31 38 43
OS X 4 10 20 18 23 27 21 25 12 20 21 17 25 26 8 15 15 28 23 24 8 15 10 34 19 33 25 16 13 12 22 21 23 22 24 12 13 25 31 24 22 17 9 6 17 26
Linux 3 16 16 16 24 21 20 10 17 21 27 24 26 30 20 14 16 22 27 35 30 15 12 18 30 29 18 24 5 15 17 16 16 20 28 7 9 19 21 20 32 20 9 16 21 22

Readme

Source
raw.​githubusercontent.​com

Sublime Auto PEP8 Formatting

About

Automatically formats Python code to conform to the PEP 8 style guide using autopep8 module Supported ST2 and ST3

Features

  • format / preview code according PEP8
  • format / preview selected text
  • format / preview all python modules in folder
  • side bar menu
  • formated code while saving

Installing

The easiest way to install AutoPEP8 in through Package Control, which can be found at this site: http://wbond.net/sublime_packages/package_control

Once you install Package Control, restart ST2/ST3 and bring up the Command Palette (Command+Shift+P on OS X, Control+Shift+P on Linux/Windows). Select “Package Control: Install Package”, wait while Package Control fetches the latest package list, then select AutoPEP8 when the list appears.

Per-project settings

{
    "settings": {
        "sublimeautopep8": {
            "max-line-length": 79,
            "format_on_save": false,
            "show_output_panel": true,
            // show Format/Preview menu items only for views
            // with syntax from `syntax_list`
            // value is base filename of the .tmLanguage syntax files
            "syntax_list": ["Python"],
            "file_menu_search_depth": 3  // max depth to search python files
        }
    }
}

Using

  • SideBar - right click on the file(s) or folder(s)
  • Active view - right click on the view
  • Selected text - right click on the selected text
  • On Save - provide by settings: option format_on_save
  • Command Palette - bring up the Command Palette and select PEP8: Format Code or PEP8: Preview Changes
  • Hotkeys - Command/Control + Shift + 8 to format code, Command/Control + 8 to preview changes