Vim Versus Emacs - Minus the Religion

Vim Versus Emacs - Minus the Religion

[Note: I originally wrote this forQuorabut am reposting it here with slight embelishment.

Introduction

In hard core technical circles, discussing the relative merits of
these two editors is pretty much verboten. In the past, debates around
this issue have actually become vicious (which is ludicrous when you
think about it) and raged on for literally years. Devotees on either
side would rarely listen to reason, and mostly everyone seemed to
think it was an either/or situation. To be honest, I think that stance
is utter rubbish.
I feel as if I'm uniquely placed to answer this one because I've been
using both for about 25 years now. (15 with almost full time Vim and
10 emacs).
First off, I want to slightly challenge your question. It's too
simplistic and there can be no answer to it the way you asked it.
Emacs and vi are both superlative editors for certain types of
things - their strengths give them super powers in very different ways
that lend them to solving some problems more easily than others.

Vi/Vim

To my mind, if your goal is simply to edit text, Vim might be better
suited to the task. Its modal editing lends itself to lightning fast
text entry, and there is a nearly infinite potential growth curve for
how its various commands and shortcuts can be efficiently brought to
bear in navigating and moving text around.
Through the years, various extension technologies have been added to
Vi (a-la Vim) that enable it to be extended in various ways, but in my
personal hard wrought experience, there are limits as to how far you
can push that extension before the both the editing paradigm and the
mechanics begin to creak and groan under the weight of what you're
trying to accomplish.
For instance, the straw that broke the camel's back for me was trying
to get IDE like method and member auto-completion and refactoring into
the editor. There are various solutions for this in Vim, but they
either just plain didn't work, or if they did de-stabilized my Vim
installation because they required the installation of C shared
libraries that were a pain to build and install. There's nothing quite
like having your editor dump core in the middle of a critical editing
session to make you reconsider your choice of tools.
Note that the above scenario has virtually nothing to do, strictly
speaking, with editing text. It's the result of trying to make Vim
into an IDE, which it isn't.
As others have mentioned Vi/Vim also has the advantage of ubiquity.
It's bundled by default on just about every UNIX system on the planet,
and that's definitely worth noting.
A great resource for Vim users is Vimcasts
and Drew Neil's excellent book Practical Vim.

Emacs

I personally think of emacs less as a text editor and more as an
incredibly powerful programming environment hyper optimized for
working with text - the upshot being that it also has very capable
text editing features.
I know that sounds like I'm just playing with words but trust me I'm
not. If you want to create the most incredibly powerful programming
environment utterly customized to your every need, then Emacs is
undoubtedly for you.
It excels at subprocess control, so for instance if you're programming
in Python, emacs will run a Python interpreter for you inside the
editor. Why would you want this you might ask? Because then you can,
while you're coding, try bits and bobs of code out and actually run it
and see how it works. Emacs can even run the Python interpreter on a
remote machine and hook it into your editing session.
At the core of emacs is emacs lisp - elisp is at the heart of emacs's
superpowers. It is the ONLY extension language available in emacs,
but it can do just about anything. You can avoid learning elisp and
still be very productive using emacs, but chances are if you're like
most people you will get sucked in eventually as the lure of sanding
the rough edges off of some mode or other becomes too great :)
You can, if you so choose, use emacs as your entire working
environment - edit, code, chat, manipulate source control (like Git) -
pretty much anything.
This is a common attack non emacs users make "It's not an editor. It's
an operating system!" and I say they're right, but they're also
missing the point :)
Excellent starter resources for Emacs users are - Pragmatic Emacs and
the book / website (both stellar) Mastering Emacs.

Summary

I realize this is a long answer, but the question is nuanced and
complex so hopefully the length is merited.
If you are mostly editing plain old text, or doing very light coding
or maybe editing static configurations, or if you need your editor
to be there by default everywhere you go in UNIX-land, then Vim is
almost undoubtedly your best bet.
If your needs are more complex, and you find yourself pushing the
envelope, asking IDE like things of your editor, or if you know off
the bat that you're a hard core developer who dreams in code and
demands the utmost in customization capabilities from your
environment, then skip right to emacs.
Ultimately, ignore all the rhetoric and religion and figure out which
will make you more productive - or do what I do and use them both! I
use vi for super quick edits on servers and emacs for heavier editing
or when I'm editing on my desktop / laptop.

Tools are just tools, use what makes sense.

[ Update 07/16/2015: My astute readers reminded me ofevil-mode** which can be seen as letting you have your cake and eat it too :) It provides startlingly complete vim compatibility inside emacs. It works great, I used it initially when I was making the transition from vi to emacs and can recommend it heartily.** ]

The One Feature that Keeps Me Addicted to Chrome

I've been using Chrome for the last few years, and generally speaking I'm pretty happy with it.

However recently Google has made some decisions (notably the on by default voice search features) that make me question the wisdom of that choice.

I also very much enjoy using Firefox, a 100% open source browser that's very actively developed by the awesome folks over at the Mozilla Foundation.

There is one feature that keeps me from making the switch though, and that's their 'multiple profiles' feature. So, in my case, I have one profile for work stuff and another
for personal.

My personal profile is signed in with cpatti@gmail.com and has all my personal default tabs, bookmarks and saved info, the other has all my stuff for my current job.

Sure, Firefox can have multiple profiles too, but Chrome makes it seamless, even allowing you to have a browser window open with each profile simultaneously. So I can keep
my personal browser window open when I feel like it, Check my Gmail etc, but if I'm in deep focus mode I can close it altogether and POOF, it's gone.
I submitted a feature request bit of feedback to Input but I'm sure they're deluged. Who knows, can't hurt, and I do think the fine folks over at
Mozilla are worth getting behind. It's important to have a major browser that's free of commercial controlling interests.

As always, just my $.02!

Oh Wordpress, I love you but you make it so hard...

It feels like there are new security issues around WordPress every week.

Admittedly, the fact that WordPress automatically updates itself helps a lot, but it does lead one to wonder if a simpler solution might make more sense.

I really like the idea of a static generator tool like Pelican, but also really enjoy blogging from my mobile devices with tools like Blogsy.

One friend suggested using Pelican, and using Github's built-in editor to create the Markdown, so I suppose I should explore that.

What I would really love to see is a solution where I could compose on my mobile devices in Markdown, then somehow get those changes checked into Github so I could statically generate my blog later from a computer.

Apparently, I want everything :)

A middle of the road solution might be to simply give up and let Wordpress.com manage my blog, but I think it's helpful to keep some skin in the game and run my own site given that I build infrastructure for a living.

If anyone reading this has any amazing solutions to the problems I pose here I'd love to hear about it!

Oh Swype, Where Have You Been All My Life?

For years my Android using friends have been revving about Swype.

When tablets and smartphones first appeared on the scene, many of us were so awash in the glow of our shiny new toys that we overlooked a glaring weak point - text input.

In a stunning display of uncreative design, the keyboards for these devices were simply 'virtualized' versions of their mechanical counterparts.

The result seems like a regular keyboard, but bereft of the comparative elegance and efficiency of touch typing we are left in an incredibly unsatisfying state of perpetual hunt and peck. To add insult to injury, this ethereal target we're eternally stabbing at changes underneath us to suit the whim of the author of whichever app we're using.

With Swype, one simply glides one's finger from letter to letter spelling our words. Swype handles tedious details like putting spaces between words or after periods.

I could keep babbling, but suffice it to say it has been a life changer for me. Paired with Blogsy, my iPad blogging ttyl of choice, you may be hearing from me more often!

The Chrome Conundrum

I Love/Hate Chrome!

Having used the Chrome browser regularly for a couple of years now, I really love quite a number of things about it.

  • It's fast

  • The developer tools are superb

  • It has a vibrant user community, including a number of very smart people whose opinions I respect who are also huge fans

However, its implementation under Mac OS X, my operating system of choice, is rather flawed in a number of respects that drive me crazy:

  • Its external monitor support is awful.  If I have Chrome open on my Macbook Pro, then disconnect my external monitor and go to a meeting, all my windows have vanished into la-la land, and no amount of killing and restarting Chrome will bring them back.  Also, creating new windows fails silently as well, I presume Chrome thinks the windows are going to the external monitor which is no longer connected.

  • No easy, native Java support! I know, I know, I can just about hear the hipster geeks rolling their eyes at this, but face it kiddos, Java was running mission critical systems while you were in diapers.  It's not dead, it's not going away, and it's an incredibly useful tool - for Chrome on OS X to not natively support Java in the browser is unforgivable.

  • Unresponsive developers - Check out the Chromium bug list and you'll see droves of OS X users screaming for Java support - and dead silence from the developers.

I haven't yet made the decision to switch back to Firefox full-time, but they're certainly driving me in that direction.  I loved Firefox for years until I fell in love with Chrome's speed, sleek design and awesome devtools.

The Joy of DevOps (Or, Return of the Living Generalist!)

One of the things I have always enjoyed about what I do is that I have, from pretty much day 1 in the technology industry, worn many hats.

No matter what my job title said, I have always done pretty much whatever needs doing whether or not it crosses into what others might consider a discipline that's not in my job description.

I like it that way. I enjoy picking up new skills, flexing my mental muscles in new ways and exploring the uncharted territory that is every new technology to rise out of the primordial ooze of Github (Or Sourceforge before it).

Way back in 1992 when I got my first job in the technology industry, I met a very wise man named Dale Dougherty (I hope I'm not mangling the spelling, it's been over two decades! (If you're out there Dale, give me a holler will you? I'd love to get back in touch) and when he asked what it was that had driven me into technology, and after I told him in the naescent, halting terms I could form at the time he smiled and said "Ah! You're a generalist. Unfortunately, those are undervalued these days. It's a great shame" or something to that effect.

Boy was he right. For the next 20 years I would end up doing tech support, sysadmin work, software development, and finally release engineering.

The industry began throwing up high walls and fences around places and processes we all used to take for granted.  "You can't do that, you're not a developer!" "Only sysadmins get root and access to production machines!" "You're a release engineer, not a developer!" Ad infinitum.

Fast forward to 2009 when folks came up with the DevOps manifesto, in which a positively radical idea is proposed: All these distinctions are useless. They do nothing to make organizations more efficient, and instead bottleneck and pigeon hole good people, keeping them from feeding their passion.

Needless to say, I love it here. I get to bring all the experience I've accumulated in 20 years hard labor in the code mines to bear, and it feels really good.

I'm building infrastructure in the cloud, learning about load balancing, high availability and I've just barely begun.

As much as the layoff I just went through was painful as they always are, that moment of dislocation pales in comparison to the satisfaction I feel in what I have accomplished in the few short months I've been doing this, and the incredible excitement I feel as my horizons have been exponentially broadened.

As I write this, I'm several thousand feet up, bouncing along over the clouds on my way to Santa Clara, California for the annual Velocity conference.

It's an incredible meeting where some of the best and brightest in our industry come together to make the web go faster and more reliably, and I can't wait to dive in and start learning :)

[Update: I'm posting this weeks later, because things get hectic. Such is life. Velocity was amazing.  Look for another post on that coming soon.]

I'm Glad Google Is Retiring Reader.

Because I and about a zillion other jilted Reader fans have now found Feedly.

Feedly is what Reader wanted to be when it grew up, but never had the chance to become.

Yes, it's that good.

Just in case anyone out there reading this is thinking "Google What?" - here's the skinny.  If you find yourself reading a lot of websites on a regular basis, constantly checking back to keep up to date with the latest, you REALLY want a feed reader like this.  With something like this, you can treat them all as if you were browsing articles in a newspaper or magazine, either slavishly reading every one or, as I do, cherry picking what most piques your interest from the stream (or firehose as we geeks like to refer to it :)

Things I love about Feedly:

  • Keyboard commands for everything - I'm a mouse hater from way back.  Force me to click at your peril :)

  • Multiple views - I can either view my stream the good old fashioned way like Reader used to do - just a big old list of text headlines, or like a newspaper with photos front and center.

  • A 'Must Read' setting for the 1% of blogs I really don't want to miss a single post from.

  • A truly superb mobile app! Can't overstate how important this is.  The iPad and iPhone apps are optimized for that format, yet as feature-ful as the desktop.  Major win! (Reader sucked at this, using it on the go was paaaainful.).

  • Laziness - if you already use Reader as I did, all your feeds import seamlessly into Feedly, and while Reader still breathes, Feedly keeps it up to date so there's zero risk in giving it a try.

  • OK I know I already mentioned the mobile experience but the iPhone app deserves special mention, it makes it *so* easy to browse my feeds on the go, marking articles I actually want to read in-depth for later perusal via one of my other faves, Pocket.

Seriously, mad props to the folks atFeedly for evolving the state of the art, giving me a seamless migration path, and generally taking an OK but generally pretty lackluster experience and elevating it to joy.

(And no, I'm not being paid by these guys, I'm just wild about the product.)

I've gone native. (Or - Google's UI and I are parting ways)

Today Google announced that they were releasing a new Composer for GMail.

It's awful.  They made the window small, and right justified it.  I feel like I have to crane my neck at an unnatural angle in order to see what I'm writing, and worse yet, they've turned my good old message composition interface into something akin to a web forum or chat window.

This is NOT what I'm looking for in my email user experience.

A few months back, Google also did a full on revamp of the GMail UI that utterly convinced me they have an unrelenting hatred of the visually impaired. The entire screen looked as if it had been bleached of color and life, and the contrast was so low I could literally barely read it at all.

After squeals of protect from a large chunk of their user base, they relented and produced a 'high contrast' setting, which was better.

In short, I can't keep feeling like I'm being punched full in the face by Google every few months. I respect their right to innovate their products in whatever way they see fit, but thankfully I don't have to choose between liking it or hitting the road.

I've switched to Apple's Mail.app and iCal. They work great, aren't actively hostile to the visually impaired, and allow me to keep using the Google back end so I can keep my old email addresses and contact info.

Apple may be many things, but one thing they are great about is providing accessibility features for the handicapped. It's not like I have any illusions about being a minority - most people can probably read the ghostly low contrast color theme just fine, and probably like the fact that their email now looks more like IM.

More power to them I say :)

Update:  Can't lie, it's been a rough go.  Gmail's IMAP access throttles throughput beyond a certain point, and Apple Mail can't handle the large mailboxes I have even with having given them a serious slim down.  I really wish there were a solution to this problem.

Update Update: I've essentially given up on this :( Mail.app just plain stinks.  It might be fine for folks with a single account or maybe very light usage on multiple accounts, but with two Gmail accounts and lots of labels, it's downright abysmal.  It takes 15-20 minutes to get everything in sync, and then often takes another 20 minutes just toexit the app!* This is not my idea of an enterprise class  eMail application.  I'm disappointed in you Apple!*

The walled garden is the future of computing.

These days it seems like almost everybody (at least almost everybody in the technology world) has made bashing Apple their new favorite past time.

One of the complaints I hear again and again is that Apple's mobile operating system that runs every iPhone, iPad, and iPod Touch are designed based on the "walled garden" philosophy - meaning that you can only install approved apps on the device from Apple's App Store unless you throw all caution (and your warranty :)) and jailbreak your device.

Compare this to Google's Android OS where the user can install anything they want, from wherever they want from wherever they want, including some fairly insidious malware. I know I've been spammed two or three times by friends who had their Android phone's address book compromised. However even Google is making moves in more restrictive directions of late, but only in their app store, which you can ignore completely if you prefer.

What these geeks are missing is that for 99% of the population, the jail is a good thing! People want their devices to be appliances. They want to browse the web without fear, write their documents and spreadsheets unfettered by things like virus checking, file systems and storage devices, and play their games secure in the knowledge that they're not pulling in a Trojan that will send Nazi supremacist hate mail to their grandma and their boss.

The hard truth for many geeks to accept is that for end users, this represents pretty much the ideal computing experience. This goes way beyond Apple and iDevices and into the realm of general purpose computers like laptops mad desktops.

All one need do is examine the marketing blurbs for the latest OS versions from Apple and Microsoft to validate my claim. Windows 8 features required code signing for installed apps, effectively the beginnings of a walled garden of their own.

As I mentioned previously, Apple lead the charge into the walled garden future I'm predicting with IOS, but with tithe release of MacOS X Mountain Lion, they're filing the rough edges from the computing experience for desktop and laptop users as well.

Honestly it's been rather amusing to,watch the geek-o-sphere practically tremble with rage over this issue, ranting and roaring on about Apple's new found tyranny.

In truth I just don't get it. Gatekeeper can be bypassed with a single key press. What's the big deal? I predict that there will always continue to be trap doors and escape hatches for those who know enough to seek them out.

Apple is in fact not trying to impose some kind of Orwellian new world order and declaring a Jihad on geeks, they're just doing what they've always done, innovating the tech in ways that will improve the quality of life for the majority of users.

Simply put, geeks need to get over themselves. Computing has become such a part of the mainstream of every day life that people don't want or need to be beholden to the techno-priesthood any longer. To my mind, this is nothing but win. Over the long haul, it means we can get out of the business of being family tech support, and get back to playing with technology and having fun pushing the envelope!

Trying out VimRepress

VimRePress

In an ongoing effort to immerse myself in Vim as much as possible, I'm trying out a plugin called VimRepress - a fork of the popular Vimpress plugin.

Installing

Unfortunately, getting it running with MacVim on MacOS X Lion is a bit of a bear, but thankfully Paulo Poiati wrote an excellent article on getting the job done.

Basically, if you're using Homebrew, you have to rebuild your MacVim to use the i386 architecture, otherwise you wind up with a Python interpreter that doesn't match the bitness of your editor, and when MacVim goes to invoke Python to run the blogging bits in the plugin, MacVim explodes.

Also unfortunately, you can't use the Homebrew built Python or Ruby interpreters when building MacVim either, and have to instead use the bundled ones from MacOS (both sorely out of date. Who uses Ruby 1.8 anymore? :).

So I had to uninstall my Homebrew based Python and Ruby, install python-markdown2 into the OSX default Python instance, and now everything seems to be working just fine.

Living the Vim Life

VimRepress and Blogging

That said, there are still some creature comforts that I miss from the awesome Blogging bundle in TextMate - silly things like giving me a drop down list with the possible Categories for my post and the like. Hopefully over time we can get those implemented in Vim land :)

On the upside, and this counts for a lot, is that I can now write in Markdown again <contented sigh> I've missed Markdown terribly ever since I transitioned the blog from Typo to Wordpress many moons ago. It's a joy to write in, and really lets me think about the writing, not about a properly formed HTML element, which is priceless.

Vim and Me In the Large

For what it's worth, thus far the minor pain of transitioning to Vim has been entirely worth it, I've definitely seen a noticeable productivity boost, and for work-a-day code and configuration editing, I'm actually finding Vim to be vastly more powerful than TextMate simply because my environment is everywhere I want to be rather than being chained to using my Mac desktop for editing and resorting to chicanery like remote mounted filesystems via sshfs.

For years I'd read The Pragmatic Programmer with its mantra of "Learn one editor, and learn it *well" (paraphrase).

I always had mixed feelings about that. I'd taken pride through most of my career in being able to learn a multitude of different tools and adapt to whatever worked best in the local environment. That is in fact a really great skill to have, but there is definitely wisdom where editors are concerned to pick one and live in it 24/7.

MacVim has helped tremendously with that. With it you can have your cake and eat it to. You can use the very same config files and plugins you use on your UNIX servers on your desktop, only wrapped in a superbly crafted Aqua GUI.

It's a continuing process, but thus far the work I've put in has been totally worth it. I would encourage anyone who's on the fence to give it a try and be strict with yourself about it. Pick a time when you can afford to take the hit and spend the time to get facile enough that you won't miss your old environment. You won't regret it.