Vimmification Part 1, upgrades!

Setting up a nice clean vim install for myself. Tired of my vim feeling bloated and slow, so I’m rolling my own config distro with just what I need.

Step 1: I need the latest version! Snow Leopard ships with 7.2 instead of 7.3, and I just don’t find being outdated to be acceptable. Fortunately macvim to the rescue!

MacVim is a nice OSX GUI wrapper for Vim. Adds that little bit of polish on over the top. Fortunately it also comes complete with it’s own Vim 7.3 install! And its “mvim” terminal command is apparently smart enough to know that it should act like normal terminal vim if called from an alias of that name. So to get the latest macvim set up and linked, all we need to do is: (Assuming you’re using brew, which you should be.)

brew install macvim
ln -s /usr/local/bin/mvim /usr/local/bin/vim

This leaves us with one problem however. The system installed /usr/bin/vim comes first in the default $PATH. In order to get the correct version simply by typing “vim” we need to reorder /etc/paths to put /usr/local/bin ahead of /usr/bin. Once that is done and saved, reload your shell, fire up vim, and you should see version 7.3.

Alright excellent, updated version of Vim ready to roll. Now that wonderful “set relativenumber” line in my .vimrc will no longer throw errors. Time to start setting it up the way I like it.

XARGS!

I think I’m having some weird conflicts between installed gems and bundled gems. Well, why do we NEED installed gems really? What’s easier than wiping out your gemset in RVM? Why this of course:

gem list | awk ‘{ print $1 }’ | xargs gem uninstall -aIx

And bam, meteor-style mass gem extinction. Bye all you nasty gems.

This took me a little bit of figuring out though. Why do I never remember the xargs command? Very useful in these sorts of situations. Yeah, I loves me some command line some days.

Further adventures of a Mac Mini…

My poor old 1.66 Core Duo Mac Mini just wasn’t performing quite as well as it used to and it was time to do some cleanup. Well it occurs to me that it might actually just run Linux pretty well. With it’s poor little 512MB of RAM, Linux gives me a bit more control over exactly what’s going on and what’s using resources! Time for the ISD-Inexorable to switch to Ubuntu 10.4 (Lucid Lynx) beta!

Adventure number one: booting off a the CD.
For some reason neither the Alt nor the C keys are triggering the bootloader to attempt to boot off the disk. This isn’t going to be a dual-boot machine, so I’m not interested in bootcamp. Turns out the rEFIt project solves this problem quite nicely! Quick install there and away we go.
Worth noting that you have to reboot twice before rEFIt shows up at boot. Got a little worried when I rebooted initially and didn’t get a bootloader menu.
So now we’re installing! Clean partition of the drive and away it goes!

Adventure number two: laggy graphics.
After rebooting out of the installer everything looks great, except that the UI is responding exceptionally slowly. Bringing up apps is slow, switching between apps takes over 30 seconds. This doesn’t seem right at all! My 1.5ghz PowerBook G4 performs far better than this! To add to the mystery the processors aren’t doing more than 15%, and I still have 100MB of RAM free. So what’s going on here?

It doesn’t seem to be the driver. The driver for the Intel integrated GMA950 doesn’t seem to have any known issues, and hasn’t in a while… glxgears appears to work fine, but when I move the mouse over another app the gears slow way down. This sounds like a window manager issue to me. Time is spent researching if GDM may have issues on this card. Nothing is found.

Then I randomly stumble across a forum post that points out a simple solution:
sudo aptitude install xserver-xorg-video-intel
I try this, without doing any further research about what it is or what it does. Quick reboot and presto, full speed GUI!

Performance:
While I don’t have any true benchmarks to compare, the machine is running both faster and cooler under Lucid Lynx than it was under OSX Snow Leopard. The OS is more responsive and taking up less memory, and video performance is improved! Under Snow Leopard the machine would lag for 10-30 seconds loading Hulu or TED videos. Even just opening a new tab in Safari would take a couple seconds. Not so anymore! I’m really very impressed Only difficulty I’m having currently is I keep using CMD- instead of CTRL- for keyboard shortcuts. I’m sure I can remap that. 🙂
Only other problem that I’m going to face is reading/writing to OS-X file systems. More on that later if it turns out to be interesting.

I’m amused that I managed to stay inside the “big cat” operating system names. In the battle of Lynx vs. Snow Leopard, the Lucid Lynx is coming out on top in this case.

Quick Hint: CSS Selectors and pseudo-classes

It seems obvious now that I know it, but it seems that I never figured out that you could use include pseudo classes in a CSS Selector.

“a:hover img” gets you any image contained inside an anchor? tag that is currently being hovered over.

Why did I never know this before? Can’t say. But it sure is handy!

Bevel Lines and woodgrains

Found this? photoshop tutorial which showed me how to fix two little issues I was having. Realistic woodgrain, AND “bevel lines”!?

The bevel line effect is exactly what I was looking for, and I don’t want to forget how to do it, so here it is:

Green-Bevel

Woodgrain_bevel

The effect is one that I’ve been searching for, but couldn’t seem to find the right keywords. It’s really super-simple to do!

  1. Create parallel white/black lines on their own layer. (Just a few px wide)
  2. Gaussian-Blur the new layer. (Radius 1.5 has worked perfectly so far.)
  3. Set the layer blending mode to “Soft Light”

And it’s Just That Easy! This is a technique I’v been looking for to create nice smooth buttons-on-a-bar.