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 62K
  • Win 27K
  • OS X 17K
  • Linux 18K
Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8
Windows 31 35 39 59 52 54 65 113 34 36 49 49 41 51 51 31 25 32 29 28 25 44 32 39 41 69 81 73 43 29 34 63 58 69 69 65 37 37 77 80 63 49 28 26 43 45
OS X 19 10 16 24 25 31 34 36 16 15 21 18 29 30 18 18 30 19 26 21 21 28 19 21 24 42 29 31 22 10 17 18 36 31 35 31 21 25 37 41 43 29 12 15 9 17
Linux 6 13 19 29 29 29 25 23 13 19 20 25 21 26 21 19 20 12 23 31 20 26 17 15 22 21 28 24 24 16 12 32 33 29 23 28 23 19 29 37 35 29 16 10 17 20

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