Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

grantm (164)

  (email not shown publicly)

Just a simple [] guy, hacking Perl for fun and profit since way back in the last millenium. You may find me hanging around in the monestary [].

What am I working on right now? Probably the Sprog project [].

GnuPG key Fingerprint:
6CA8 2022 5006 70E9 2D66
AE3F 1AF1 A20A 4CC0 0851

Journal of grantm (164)

Thursday June 22, 2006
05:20 PM

My dotfiles

[ #30013 ]

Since Ovid seems to be getting buried under "Duh! - Use a revision control system" comments, I thought I'd describe my solution here.

I have a CVS repository (I'd use SVN if I was starting from scratch) that contains my 'dot' files and other stuff. I check it out into a directory called '.common-configs' with a command like this:

cvs -d ":ext:grant@cvs.server/cvs" co -d .common-configs grant/configs

Then I cd into .common-configs and run './install' which interactively walks me through installing each of the files. Some of them are a straightforward replacement of the default ~/.file with a symlink to ~/.common-configs/file. And some of them leave machine-specific things in ~/.file and append the necessary entry to include the contents of ~/.common-configs/file.

So what's in my CVS repository?

A collection of aliases, shell functions, PATH manipulations and general environment hacks that I've assembled over the years. Includes the 'hint' alias (see below).
Standard things like setting -q on all commands, -u for all diffs and -dP for all updates.
A script for tunneling CVS (backwards) through SSH. Used for situations where the target machine can't SSH to the CVS server but it is possible to SSH from the CVS server to the target machine.
A bunch of hints used by the 'hint' alias (see below).
GNU readline tweaks like setting Ctrl-F for going forwards through command history (after you went too far with Ctrl-R).
My shiny new 'irb' preferences file (Ruby Rocks!)
My .vimrc maps F4 (typically 'make') to pass perl scripts/modules to this script. It's essentially just 'perl -cw' but preceded by all sorts of adjustments to PERL5LIB depending on the full pathname of the file being checked.
A modest collection of config hacks for the 'one true editor' :-) My bashrc commonly aliases 'vi' to 'gvim' where available and supported by X forwarding etc.
A directory containing a collection of template files accessed by the ',t' macro from vim. Templates include: html (a skeleton HTML file with DOCTYPE, content-type/encoding and stylesheet tags); perlscript (skeleton script with Pod::Usage and Getopt::Long code and POD); pod (POD outline for a .pm file); test.t (standard Test::More invocation with and without a plan); and sundry other things.

The hints file is becoming increasingly necessary as my memory fails and the scope of technologies I deal with increases. The hints file itself is merely a plain text file of one-line entries of the form:


My bashrc file defines one shell function and one alias:

function hint() {
    test -n "$*" && sed -n "/$*/Is/^\([^:]*:\) *\(.*\)$/\1\n\2\n/p" ~/.common-configs/hints
alias vihints='vi ~/.common-configs/hints'

Then when I want to be reminded of (for example) the command syntax for fixing a typo in a CVS commit message, I just type:

hint cvs fix

and get a response like this:

cvs fix comment:
cvs admin -m 1.12:"replacement commit message here"

The point is that the output from 'hint' is something that I can cut and paste and adapt to my current requirement. The other important thing is that the things in the hints file are things I have had to search for and things I find useful. It's not clogged with things that other people think I need to know. Therefore I won't tell you what is in the file but just tease you with a random sample of topics covered:

  • CVS
  • Subversion
  • Debian package manipulations
  • GnuPG
  • Perl one-liners
  • ImageMagick hacks
  • LDAP queries
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.