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 weeks ago
  • 32 minutes ago
  • 6 years ago

Installs

  • Total 9K
  • Win 5K
  • OS X 2K
  • Linux 2K
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 3 2 3 1 1 3 2 3 0 2 8 1 1 2 2 0 0 3 3 3 0 2 1 2 1 2 4 2 3 1 1 3 4 5 4 4 0 0 2 2 7 5 1 3 2 2
OS X 0 1 0 1 0 2 0 0 0 1 0 1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 2 0 1 0 2 3 1 2 1 0 2 1 2 1 0 1 0 0 1
Linux 0 0 0 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 2 0 2 2 1 1 0 0 0 0 1 1 1 0 2 0 0 2 2 0 0 0 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" } },