Skip to content

Instantly share code, notes, and snippets.

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
// Please, please, please don't try this at home
$(document).ready(function() {
$("a.meatloaf").on("click", function(e) {
// Once upon a time, there was a developer...
e.preventDefault(); // Prevent the default behavior
e.stopPropagation(); // Not working like expected, so stop it
e.stopImmediatePropagation(); // No really, stop it
return false; // Just in case... STOP IT!
// Moral of story: Know what each of the above statements mean
});
// Avoid `console` errors in browsers that lack a console.
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeStamp', 'trace', 'warn'
];