I spend a lot of my day working on the command line, from file navigation to version control to remote work on servers over SSH, and anywhere in between. I’ve found that even small improvements to my workflow significantly add up over time to provide big productivity boosts.
I’ve been using Vim as as my primary text editor for a little over a year now, and I’d like to share some of my favorite commands that I’ve discovered during that time. I’ll focus on sharing commands over configuration, so they can be used in any Vim environment.
Until recently, I had done all of my coding in IDEs and GUI text editors. From Notepad++ to Visual Studio and Xcode, I felt like my text-editing toolset was more than adequate for the work I needed to do. I knew about Vim and Emacs, but they both seemed like esoteric, rocket science editors that only […]
Way back in 2011, I wrote a blog post showing how to Run Tests from MacVim via Terminal.app or iTerm.app. I’ve been using that setup for years without a problem, but when iTerm2 Version 3 was released, it stopped working. I’ve updated the AppleScript and am posting it here for anyone who wants to run […]
Stroll around our Grand Rapids office, and you’ll find some unique input methods. Curved, split, and mechanical keyboards, mice shaped like everything from sashimi to joysticks, giant trackpads, drawing tablets, Echo Dots, and Yetis. We like to keep things interesting when it comes to our workspaces. For the last hundred days, I’ve been kicking around […]
I’ve recently been doing some basic Clojure development, and it’s been a huge blast. I’ve played around with it in the past, but never bothered to fully set up a development environment. This time, however, I decided to spend a few evenings perfecting my workflow and becoming familiar with the tools available, focusing on my editor of […]
Vim is a pretty great text editor, but learning to use it effectively can be a challenge. Even if you keep a quick-reference card or cheatsheet around, it can be difficult to figure out which commands are the most useful. But the truth is, Vim can still be super helpful if all you know is a few commands. So […]
Years of using the testing framework RSpec has spoiled me. Because you can pass a filename and line number to the RSpec command and it will run only that test, it’s trivial to set up a Vim key binding that runs the test under the cursor. For example, nnoremap <buffer> <LocalLeader>a :exe "!rspec ".expand("%").":".line(".")<CR>nnoremap <buffer> […]
Vim macros let us transform code like no other editor. Here’s how they work: Pick a register to record into. (A Vim register is like a little slot where the macro data will be stored. We usually want to record into one of the named a-z lowercase letter registers.) Begin recording with the q command. […]
Tmux is a powerful terminal multiplexer, and its built-in support for scripting allows you to create new features according to your own workflow. I spend most of my day in Tmux, at the command line, grepping through codebases and editing files with Vim. I copied and pasted or re-typed file names for a long time […]