Category Archives: Unix

Useful Vim Mappings

A few mappings to help boost your Vim workflow.

Rotate through different line numbering settings

Switch between absolute line numbers (normal), relative numbers (based on distance from your cursor) and no numbers at all using CTRL-n:

Continue reading Useful Vim Mappings

A Web Developer’s OS

What must an Operating System do to satisfy web developers’ needs? This is a tricky question, as each person is a whole different world, so it’s impossible to have a single answer to satisfy every┬áperson.

One could say “Well, because each person is different, the OS must be able to adapt to all different kinds of people”. Basically, meaning the OS must be easy to customize. This is great, but when is it too much customization? Systems that are very customizable also tend to be hard to use. In this post I’ll compare the three most used Operating Systems out there, namely Windows, OS X and GNU/Linux. I like FreeBSD but the userbase is so small I sadly won’t consider it here.

When talking about customization, I’d say Linux is king. Windows, on the other hand, is not natively customizable, but easy to use and with sane defaults. OS X gets the best of both worlds. That’s just my humble opinion, as I don’t consider myself to be a full power user of any of those systems, I just use them to get work done on a daily basis.

Continue reading A Web Developer’s OS

Removing intermediate directories

We recently needed to remove the intermediate directories in a large number of parent directories. So, if we started with /A/B/C/D, we wanted to end up with /A/B/D. It seemed simple at the time, so I blithely said “Sure, I can write that easily as a shell script”.

Of course, I should’ve known better. The intermediate directories were using company and person names, so they often contained apostrophes, ampersands, dashes, etc. Rather than going a bit nuts trying to coerce the shell to work with these, I switched gears and converted the script to use Python instead. This required a little more work than the Bash script did, but had the desired effect of giving more consistent results. See here for the resulting script:

remove_intermediate_dirs

Continue reading Removing intermediate directories