December 25, 2008

Day 25 - dotfiles and power users

Dotfiles are precious. They help you maintain your desired environment. My dotfiles have been built very slowly over time as I find features I like or change the way I use a tool. Additionally, I learn by reading other people's rc files. Ignoring your ability to make very useful changes in behavior and operation of your favorite tools will leave you at a very minimal level of productivity.

The more time you spend using a tool should mean putting more time into configuring it and learning about it. Using a program with its defaults alone, over time, is a massive productivity killer. For example, the speed at which I was able to do things in a unix shell skyrocketed when I learned that I could have vi keybindings in my shell (with 'set -o vi' or 'bindkey -v' in most shells).

As mentioned above, part of learning how to configure a tool is simply reading documentation, or searching online for how to do something. Another important part is by learning from others: reading their dotfiles. In order to read your dotfile, it must be available somewhere. I heavily encourage you to post your rc files online. Not only publish them, but make sure you put comments describing what each configuration decision does. Knowledge grows faster when there's a community contributing to it, so post documented snippets online!

Rather than covering another best practice or tool, today's article is an attempt to try and fill your mind with some useful things you may want to try in your own tools. Covered below are some of my configurations for various tools. Each configuration has a link to respective documentation (if available online) about that option. Futher, it is not my hope that you agree with my configurations, but that you find options here that you didn't know about that might help you.

In the process of reading peer rc files and gathering data for this article, I found a neat website where people can publish their own dotfiles, dotfiles.org. This site lets you view everyone's uploaded dotfiles.

There are far too many tools and options to cover, so I'll cover the three tools closest to my heart: zsh, vim, and screen. However, before I get into it, I want to make a few, important points.

  1. Vi mode in your shell is one of the best features available if you are familiar with vi. Bash, ksh, zsh, and tcsh all support 'vi mode' in varying degrees of compatibility. In your shell, type 'set -o vi' (bash, ksh) or 'bindkey -v' (zsh, tcsh), and be happy with your increase in productivity.
  2. Set your terminal (screen or terminal) title! There are lots of existing rc files that show you how to do this. For zsh, try searching zsh screen title.
  3. Don't ignore configuration of tools you use every day. Being a power user doesn't mean you automatically do lame things like recompiling vim with -O9999, it means understanding the tools you use and how to configure them to best fit your pattern of work and your style preferences.
To repeat one more time, publish and document your dotfile configurations. Ok, on to some options for zsh, vim, and screen.

3 comments:

  1. If you put the following into your ~/.inputrc:

    set editing-mode vi

    ... you'll find that vi editing mode also works in any readline linked application too - eg psql, mysql, irb...

    ReplyDelete
  2. The problem with custom dot files is that your productivity dives as soon as you are on site at a customer. You appear (or feel) slow and clumsy without having access to your common environment.

    For this reason, I minimse changes to dot files and try to improve upstream defaults when possible.

    ReplyDelete
  3. There may be some advantages to keeping things vanilla if you're always having to use other people's machines and setups. But I spend most of time working on my machine(s), in my account(s), doing my work, and the advantages of customization are unquestionable.

    Realistically, any customer account I'm going to have to use might have their own customizations doing weird things, so knowing how things should work without changes doesn't necessarily buy me anything.

    I also have a nice monitor, keyboard, trackball, and OS that may be different from (though not necessary better than) those that most of the people I support have, but I wouldn't give any of those up, either, unless it was to replace them with something better.

    ReplyDelete