Gil's profile at Stack Overflow Coding challenges at Project Euler



Three tools to stay in the zone

So precious are those moments when we, software developers, find ourselves in the flow; yet exiting that state is way too easy. Today I will describe three tools you can use to stay in the zone, to boost your productivity and accomplish more.

Vimium (Chrome)

What: Mouse-free web surfing.

Why: We all google a lot. It goes like this: search something, scroll the page, click the url bar and refine the search, click on a result, go back, click on another result, etc. Moving our right hand to the mouse and back is simply distracting. Vimium solves the problem giving you shortcuts to navigate among pages, among tabs, and in the history. The ones I use the most are:

Check out all the commands typing ?. I combine Vimium shortcuts with the following Chrome shorcuts:

Vimium f shortcut

Autojump

What: Smart cd command.

Why: I like building my project in the terminal, run script in the terminal, branch in the terminal. I use the terminal a lot. But jumping from one directory to another in a completely different place in the filesystem is a pain. Surely, most of you have probably already mastered:

All these commands are quick ways to move to places relative in time, but what if we need to go to a folder we haven't been recently in? Autojump comes to rescue. Autojump keeps a database of the directories from where you usually run commands. Then, you can jump to a directory with a fuzzy match. Suppose I often run commands from ~/Desktop/Projects/Android/MyApp. Then I can jump to it by just running:

j app

Autojump jumping in a folder

Hammerspoon (OS X)

What: Move windows around with keyboard.

Why: Ever wanted to have two windows side by side, half of the screen each, and tried to use the mouse to do it? Luckily there is a better way. Meet Hammerspoon. Hammerspoon is an automation tool that binds the OS X api to Lua scripts. Basically you can manipulate windows, the mouse pointer, file systems, batteris, etc. with Lua scripts. In practice, I use it to move windows around with my keyboard.

For example you could assign the combination Alt-Cmd-left to resize the current window to the left half of the screen and Ctrl-Alt-Cmd-right to move the window to the monitor on the right. It also can do a function similar to f of Vimium but for OS X windows: it shows a label on each window (also the hidden ones) and you can focus it typing the letters in the label (see image below). Before Hammerspon I used Spectacle, but it lacks this labeling/hinting functionality. If you want to try it, a good place to start is from my init.lua configuration and tweak it for you needs.

Furthermore, here are some more OS X shortcuts for manipulating windows:

Hammerspoon labelling shortcut

These three are fundamental tools in my arsenal. I also use Alfred, an improved Spotlight with Google search, and Dash, a documentation tool so I don't need to hit the network for some javadoc.