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 69K
  • Win 31K
  • OS X 19K
  • Linux 19K
Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7
Windows 42 28 66 57 76 66 37 40 40 56 109 77 58 62 51 72 74 88 96 60 40 29 42 40 61 83 69 52 34 32 52 55 47 74 68 34 44 70 56 68 63 50 42 44 49 59
OS X 9 12 26 23 32 27 14 16 15 23 25 27 30 25 18 18 30 16 23 17 9 7 8 23 17 25 17 12 14 6 19 20 30 21 22 17 14 18 30 27 22 28 12 14 18 27
Linux 18 16 36 34 34 22 26 14 19 28 26 20 27 29 15 20 23 28 15 18 14 16 16 18 20 27 28 8 14 13 23 21 27 23 20 15 13 28 22 25 34 23 16 15 27 19

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