I periodically run into new developers. It’s a wonderful opportunity to see what other people are doing and what areas they work in. It always amazes me at how limited my own work and pursuits are in the grand scheme of things. I feel like I diversified myself at my old company by working on many different projects for different customers. In my current position, it seems like I get handed many tasks that aren’t closely tied together. But when I speak to others, it seems like there is an even wider range of things that are out there! Software really is amazing.
Inevitably, we want to know what tools we each use, what platforms we develop on, and the love/hate people have for Microsoft/Apple/Google comes out as well. I have never seen things go as viscous as things do in political discussions, but there are strong opinions everywhere in the arena of software and our tools. Of course, I always end up mentioning I use vi. A lot. Usually at least one, if not half of the people I speak to use it as well. Guess what? The other half use a GUI editor. Might I add, that they sniff that their GUI editor is more befitting our modern era. Heck, back in grad school, that was MY thinking. Someone mentioned they used vi, and I thought they were whacko. As succinctly stated, vi was created for terminal editors and predates the window-based revolution. (BTW, sometimes I find one person that uses emacs. I’m just saying.)
Of course, they’re right. vi DOES predate the era of windows. I don’t know why this implies pre-windows was somehow the dark ages, but that is the sense that I get. In this moment, if I’m feeling more confident in my choice of vi than my other colleagues, I put a foot forward and explain why. It’s the only editor that is always available no matter how I access a remote, non-windows server. That is it. Login in to a terminal server and then ssh to your box, and all you have is a shell. Trying to open a GUI texteditor requires:
- You must use ssh correctly, so that it forwards X port requests to your local box. No extra arguments, and this doesn’t work. Oh, you used a terminal server? Sorry. Do not pass Go, do not collect $200.
- You must have a local X server running.If it’s windows, that means buying some commercial software and having it open correctly (or already be open).
- Your remote server must have this editor already installed. You want a specialized editor just like your development environment? You may have to go install it everywhere. What if you your development machine and target server are two different operating systems?
- Visit Gmail? You can use “j” and “k” (i.e. down and up) to navigate through your list of email messages without moving to the mouse.
- What about Google Reader? Same thing.
- “But I don’t use Google! They are evil.” It doesn’t stop there. Checkout Twitter. You can hop from tweet to tweet using the same thing.
Next time you visit a web app, checkout if it responds to vi commands. You might be surprised. Perhaps this sounds like a self-fulfilling prophecy or old technology holding on for too long, but there is something to be said for efficient patterns that are still heavily used more than 40 years after invented.
Just for giggles I opened gmail, and opened up an email. Pressed hjkl.. Nothing happened. None of the keys moved me to the next email.
Not convinced, but I want to be.
I am having the same issues in Gmail. I have tried this in both Chrome and Safari. It did work for me in Twitter though. What browser do you use Greg?
I use Chrome. “j” and “k” seem to work. If you want to check, hit “?”, and see all hotkeys. Same for twitter.
When I hit “?” this showed me that I had keyboard shortcuts disabled. Thanks. That is really useful.
Forcing yourself to work with a non-ide editor will also cause you to become more knowledgable about your programming language of choice, libraries, and other syntax and constructs that are typically auto-generated for you by your IDE. I like to use vim and scite for C, C#, and Ruby development all in different tabs at one time. For those who are uninitiated into the tradition of vi, check out vimcasts.org and yes I know that vim != vi, but its still a great learning site.