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 53K
  • Win 23K
  • OS X 15K
  • Linux 16K
Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8
Windows 48 49 46 36 28 32 29 48 41 50 44 23 34 51 46 47 59 46 25 28 40 33 27 32 26 29 32 37 47 57 55 47 34 37 47 54 51 44 34 27 18 45 57 50 46 49
OS X 20 12 15 23 11 7 30 20 29 29 30 12 12 21 12 23 12 17 7 5 25 14 17 13 13 12 12 20 31 21 29 17 17 14 19 23 20 27 20 12 8 21 22 21 13 24
Linux 21 30 23 16 10 13 25 28 19 21 14 9 11 23 23 16 20 18 14 20 20 23 28 28 19 16 18 21 19 21 21 24 15 16 27 24 22 25 27 7 7 16 19 19 22 18

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