Switching project contexts causes needless friction and opportunities for distraction as we try to pull up related tabs and applications. I learned a trick from David Sparks on how to use the Mac automation software Keyboard Maestro to create palettes of shortcuts grouped by context. This has been an awesome boost to my productivity!
Sam Julien: [0:00] Switching project context causes needless friction as we try to pull up related tabs and applications. I learned a trick recently from David Sparks on how to use the automation software Keyboard Maestro to create palettes of shortcuts grouped by context to help with this.
[0:14] For example, I've got mine set up so that I can hit an Option-Control-Command-B to bring up a bunch of links related to my site business. You can see that it highlights the letters in blue, and I can start typing S and then T to launch the "Stacking the Bricks" podcasts.
[0:29] Let me show you how to create one of these yourself. First, I'm going to launch Keyboard Maestro. You can see on the left that I've got context set up for Business, Personal and Work. Let's go ahead and create a new group for Development, so I'm going to click this button down here, and I'm going to call this Context: Development.
[0:46] Let's say that I'm working on a project with MongoDB, and I'm tired of getting distracted by having to hunt around for different links and repos to open, so I'm going to create my first macro in this group.
[0:56] I'm going to call this Mongo Docs, and the key here is that we need to give each of these macros the same keyboard trigger to trigger this pallet. I'm going to give this a trigger of a Hot Key, and it's going to be Control-Option-Command-D.
[1:11] Now I need to give this an action. I'm going to click on New Action. I'm going to use this Open a URL action and drag that over and let's make this the link to the Mongo Docs, so docs.mongodb.com. Cool. Now, let's duplicate this and I'm going to change the name to Mongo Atlas, and I'm going to change the URL to cloud.mongodb.com.
[1:36] Lastly, I can create another macro that's going to open up my repo in Visual Studio Code. I'm going to create a new macro. I'm going to call this Zelda Mongo Repo, give it a new trigger. That's a hot key. Again, we want to make sure this key is the same as the others.
[1:53] I'm going to say Control-Option-Command-D. This time, I'm going to give it a new action, but instead of the URL, I'm going to open a folder. I'm going to start typing folder and drag this one over, Open a File, Folder or Application. I can come over to this little folder icon over here and click it.
[2:09] I'm going to go to my zelda-mongodb folder and select it, and then I'm going to choose the application over here and set that to code.
[2:17] Another neat thing I can do is resize the window. I'm going to come back over to my Actions, start typing move, and then use this Move a Window action, and I'm going to click on here to choose Move and Resize and set it to Full Screen.
[2:32] That's all we need to do to create our palette. Let's see it in action. I'll do Control-Option-Command-D, start typing M for Mongo, then A for Atlas, Control-Option-Command-D, M and then D for Docs, and then Control-Option-Command-D and then Z for the repo, and you can see that it's made it full screen.
[2:51] Now, I don't need to fumble around, looking up bookmarks, or getting distracted by other sites or repos. I can just navigate to exactly what I want when it's time to work on this project.