Keyboard Maestro – It’s the Little Things
I’ve been using Keyboard Maestro to make myself more efficient. Even the littlest things can (and should) be automated to save time.
I spend a good portion of my day navigating directories in iTerm. Often I find myself jumping up a directory (back) and then listing the directories to get my bearings.
In about 30 seconds I made myself a quick hotkey that will be active during iTerm sessions (it’s within my iTerm group, which is only active for the iTerm application) and will perform both operations (
ls). I mapped this to
CMD-uwhich I think of as “up” so it’s easy to remember. Notice there is a return (linebreak) after the
ls; this will simulate hitting return, which will execute the preceding commands. I could have added a return keystroke action, but this is just faster and requires less actions.
I encourage you, if you’re a KM user, to think about the little things and figure out where you could shave off keystrokes, mouse clicks, etc. to make yourself as efficient as possible.
Determining Your Most Used Commands in Terminal
I’m always looking to automate things using Alfred, Keyboard Maestro, Text Expander, and Python. I was curious which terminal commands I use most often, so I did some experimenting. Basically I wanted to know how many times I’ve executed each unique command ( ssh myserverx or ssh myservery, not just ssh). I started by piping the output of history to sort (to group), then to uniq (to count), then back to sort (to sort by the number of occurrences).
1history | sort | uniq -c | sort -n
1cat ~/.bash_history | sort | uniq -c | sort -n
Using Alfred to open Chrome and Firefox Bookmarks
I was looking for a decent Alfred workflow to let me easily open my Chrome bookmarks from Alfred. The search lead me to a tool called Brow and this blog post. I’m just writing here to recommend the solution to others. It’s working great!
Keyboard Maestro – Paste into Vim (with formatting):set paste and :set nopaste . Using paste mode makes it simple to paste text while maintaining whitespace, but some other aspects of Vim are reset in paste mode (e.g., autoindent and smartindent). I’m sure there’s a way to make it easier to flip back and forth within Vim (via .vimrc), but if you want a universal way to do this, regardless of the Vim settings that are in place, you may find the following Keyboard Maestro macro helpful.
Keyboard Maestro – Alfred Integration
I’ve been using the Alfred Maestro workflow for a bit now. It’s very nice to be able to call Keyboard Maestro macros via Alfred.
It took me some time to figure out why some of my macros weren’t available in Alfred.
Make sure that if your macro group (or macro) is setup to be Available in the following applications that you include Alfred 2 in the list. Also, if you need the macro group or macro to be available in the KM built-in Trigger macro by name you should include Keyboard Maestro as well.