Skip to content

Instantly share code, notes, and snippets.

@2shortplanks
Last active July 13, 2019 06:03
Show Gist options
  • Save 2shortplanks/5051485 to your computer and use it in GitHub Desktop.
Save 2shortplanks/5051485 to your computer and use it in GitHub Desktop.
ProTip for Sublime Text mac users: Remap ⌘P <return> in Terminal with Keyboard Maestro to stop accidentally printing stuff
<?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">
<!--
Sublime Text uses the Cmd-P keboard shortcut to show a menu of recent
buffers. Hitting return selects the next buffer.
This means Cmd-P <return> is a quick way to switch between two buffers
in Sublime Text.
However, if you type Cmd-P in Terminal it brings up the print dialog.
If you then type <return> it confirms the dialog, printing the terminal
contents.
This means if you use Sublime Text a lot and you try to switch buffers
when you've actually got Terminal as the front most app you'll end up
printing the terminal contents.
Oops.
This macro binds Cmd-P <return> to "switch to sublime text 2" in
Terminal.app
Much better.
-- Created By Mark Fowler <[email protected]> 2013-02-27
-- Distribute under the Artistic Licence 2.0
-->
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>OnceAfterTrigger</string>
<key>AddToMacroPalette</key>
<false/>
<key>AddToStatusMenu</key>
<false/>
<key>IsActive</key>
<true/>
<key>KeyCode</key>
<integer>35</integer>
<key>Macros</key>
<array>
<dict>
<key>Actions</key>
<array>
<dict>
<key>AlreadyActivatedActionType</key>
<string>Normal</string>
<key>Application</key>
<dict>
<key>BundleIdentifier</key>
<string>com.sublimetext.2</string>
<key>Creator</key>
<integer>1937072748</integer>
<key>FileType</key>
<integer>1095782476</integer>
<key>Name</key>
<string>Sublime Text 2.app</string>
<key>NewFile</key>
<string>/Applications/installed/Sublime Text 2.app</string>
</dict>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<true/>
<key>MacroActionType</key>
<string>ActivateApplication</string>
<key>ReopenWindows</key>
<false/>
<key>TimeOutAbortsMacro</key>
<true/>
</dict>
</array>
<key>IsActive</key>
<true/>
<key>Name</key>
<string>Switch to Sublime Text 2 rather than Print</string>
<key>Triggers</key>
<array>
<dict>
<key>FireType</key>
<string>Pressed</string>
<key>KeyCode</key>
<integer>36</integer>
<key>MacroTriggerType</key>
<string>HotKey</string>
<key>Modifiers</key>
<integer>0</integer>
<key>TriggerRepeat</key>
<false/>
</dict>
</array>
<key>UID</key>
<string>34217F89-CE3A-41BC-878B-947A071F0559</string>
</dict>
</array>
<key>Modifiers</key>
<integer>256</integer>
<key>Name</key>
<string>No more accidental Terminal prints</string>
<key>Targeting</key>
<dict>
<key>Targeting</key>
<string>Included</string>
<key>TargetingApps</key>
<array>
<dict>
<key>BundleIdentifier</key>
<string>com.apple.Terminal</string>
<key>Creator</key>
<integer>1061109567</integer>
<key>FileType</key>
<integer>1095782476</integer>
<key>Name</key>
<string>Terminal.app</string>
<key>NewFile</key>
<string>/Applications/Utilities/Terminal.app</string>
</dict>
</array>
</dict>
<key>UID</key>
<string>8E24D230-1432-4AC7-9D1E-1D7EE677D547</string>
</dict>
</array>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment