Programming fonts

Once a decade or so I get to review my Vim configuration, which also usually brings my attention to all the things surrounding – bash, terminal, etc.  This time around I wasn’t looking for anything in particular, but somehow I stumbled across the Top 10 Programming Fonts.  Of course, this one of those lists that will vary from person to person, but given that I am not particularly into fonts, I thought I’d just try the ones recommended and maybe switch my day-to-day font to something better.

Gladly, these days, trying TrueType Fonts on Linux is really easy.  Many are available directly through package management.  The ones that not, can be simply downloaded into the fonts folder (/usr/share/fonts or  ~/.fonts or whatever your distribution supports).  Trying out the fonts from that article, I arrived to these conclusions:

  • Inconsolata is going to be my font of choice for now.  It’s quite different from everything I’ve been using until now, in particular, it’s much thinner.  But I love how easy it makes distinguishing zeros from upper O’s and ones from lowercase L’s.  Bonus points for being available through yum install levien-inconsolata-fonts.noarch .
  • If Inconsolata weren’t easily available, I’d go with Droid Mono.  Which is available through yum install google-droid-* .  It’s very easy on the eyes, even if it doesn’t differentiate 0/O and 1/l so well.
  • I would have never chosen Monaco – even though it’s easy to try. I find this surprising, as I though Apple were very picking about their fonts.  Maybe they are.  But Monaco is hard on the eyes.  I’ve opened a couple of screen of ugly code and my eyes nearly bled from lack of space and the amount of curvy edges.  To each his own though.
  • Microsoft’s Consolas is a good font and I remember trying it out before.  But given that it’s not that easy to find around and install, I decided to completely ignore it this time.

What’s your favorite font for programming?

I had to edit a few files remotely today, and, boy…

I had to edit a few files remotely today, and, boy, does Vim shine over ssh connection while working on a weird touch-screen keyboard of an Android phone!  I caught myself thinking that modal editing was invented for mobile devices, where the multi-touch is limited (hence the key-combination shortcuts), and there is a total or partial absence of control and functional keys.

Avoid ESC in Vim

OK, this is one of those times when I’ve been humbled again.  I’ve been using Vim for over a decade now, and once in a while it occurred to me that using ESC to exit to normal mode is NOT the most efficient thing ever.  Maybe my little finger is too little, or maybe my keyboards are too large.  But reaching ESC with while in the middle of crazy typing session broke my concentration a few times.  But somehow I just thought that it is one of those most natural Vim things that I had to get used to.  Today, I came across something genius that told me that I don’t have to.  If you have the same problem, edit your .vimrc file and add the following lines:

" exit to normal mode with 'jj'
inoremap jj <ESC>

Once you load your new configuration, typing ‘jj‘ in insert mode will be equivalent to press ESC key.  Brilliant!