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

Text​Formatting

Adds text-formatting tricks to Sublime Text. Mostly for PEP8 formatting.

Details

  • 2 2013.07.09.15.20.32
    3 2.4.0
  • github.​com
  • github.​com
  • 4 months ago
  • 1 hour ago
  • 6 years ago

Installs

  • Total 9K
  • Win 5K
  • OS X 2K
  • Linux 2K
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 Dec 6 Dec 5 Dec 4
Windows 1 2 1 1 2 3 2 2 5 1 3 0 2 0 1 1 0 0 2 0 3 1 3 3 3 0 0 0 1 3 3 2 2 3 3 3 2 1 3 2 1 3 3 5 5 2
OS X 0 2 1 0 0 0 1 0 0 3 1 0 0 0 1 2 2 0 0 1 0 0 0 0 0 0 0 1 1 3 0 0 0 1 0 0 0 1 0 1 1 0 1 2 1 2
Linux 0 0 0 1 0 0 0 1 0 0 2 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 2 0 0 1 1 1 0 0

Readme

Source
raw.​githubusercontent.​com

Text Formatting

Adds text-formatting tricks to Sublime Text. Mostly for PEP8 formatting.

Installation

  1. Using Package Control, install “TextFormatting”

Or:

  1. Open the Sublime Text 3 Packages folder
- OS X: ~/Library/Application Support/Sublime Text 3/Packages/
- Windows: %APPDATA%/Sublime Text 3/Packages/
- Linux: ~/.Sublime Text 3/Packages/
  1. clone this repo
  2. Install keymaps for the commands (see Example.sublime-keymap for my preferred keys)

Sublime Text 2

  1. Open the Sublime Text 2 Packages folder
  2. clone this repo, but use the st2 branch

    git clone -b st2 git@github.com:colinta/SublimeTextFormatting

Commands

text_formatting_maxlength: Wraps text to maxlength (default: 80) characters. Select a bunch of docstrings or README content and it will not just warp lines, but it will also combine lines that are too short, so you can with aplomb and reformat when you're done.

Also works with comments. Lines that have # or // are considered part of the “indent”, and so they'll be removed and re-added.

text_formatting_debug_python: Select multiple variables, then put an empty cursor somewhere and run this command (default: ctrl+p twice or ctrl+p,p). You'll get some good debug output that looks like this:

print("""=============== at line 38 ===============
looks: {looks!r}
like: {like!r}
this: {this!r}
""".format(**locals()))

text_formatting_debug_ruby: Similar to text_formatting_debug_python (default: ctrl+p, ctrl+r or ctrl+p,r). Output looks like this:

puts(<<debug)
=============== at line 49 ===============
looks: #{looks.inspect}
like: #{like.inspect}
this: #{this.inspect}
debug

For rubymotion development, you can use NSLog instead of puts:

{ "keys": ["ctrl+p", "ctrl+p"], "command": "text_formatting_debug_python", "args": { "puts": "NSLog" } },