diff options
author | Arturo Fernandez <arturofernandezm@gmail.com> | 2017-08-03 15:19:45 -0700 |
---|---|---|
committer | Bill Wendling <morbo@google.com> | 2017-08-12 15:40:50 -0700 |
commit | 2e7952b348f6444f7a9d781f96bf0e8cdfea7895 (patch) | |
tree | 503fa8e914ffd6fcf543f21fbe54a4d5a4c30cfc /plugins | |
parent | 675e4907fa276a076fe1bce287e625cc6c76721a (diff) | |
download | yapf-2e7952b348f6444f7a9d781f96bf0e8cdfea7895.tar.gz |
Adding plugin for Textmate2 editor
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/README.rst | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/plugins/README.rst b/plugins/README.rst index 7f24a9b..b6a3e0c 100644 --- a/plugins/README.rst +++ b/plugins/README.rst @@ -39,3 +39,45 @@ It is compatible with both Sublime Text 2 and 3. The plugin can be easily installed by using *Sublime Package Control*. Check the project page of the plugin for more information: https://github.com/jason-kane/PyYapf + + +Textmate 2 +========== + +Plugin for ``Textmate 2`` requires ``yapf`` Python package installed on your system: + +.. code-block:: shell + + pip install yapf + +Also, you will need to activate ``Python`` bundle from ``Preferences >> Bundles``. + +Finally, create a ``~/Library/Application Support/TextMate/Bundles/Python.tmbundle/Commands/YAPF.tmCommand`` +file with the following content: + +.. code-block:: xml + + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> + <plist version="1.0"> + <dict> + <key>beforeRunningCommand</key> + <string>saveActiveFile</string> + <key>command</key> + <string>#!/bin/bash + + TPY=${TM_PYTHON:-python} + + "$TPY" "/usr/local/bin/yapf" "$TM_FILEPATH"</string> + <key>input</key> + <string>document</string> + <key>name</key> + <string>YAPF</string> + <key>scope</key> + <string>source.python</string> + <key>uuid</key> + <string>297D5A82-2616-4950-9905-BD2D1C94D2D4</string> + </dict> + </plist> + +You will see a new menu item ``Bundles > Python > YAPF``. |