Subject: Easy Good Date: Fri Mar 16 14:08:21 PDT 2007 Text-Type: markdown Tags: config, ratpoison, screen Config file post-o-ramas are always entertaining, at least for me. I was inspired to write this one because [mark pilgrim's](http://diveintomark.org/archives/2007/03/15/good-easy-2007) and [neil dunn's](http://ndunn.com/2007/good-easy) were so bloody similar to mine, but it seems I shy on the side of excess complexity. Quoting the inspiring part of mark's post: > It’s true that you can spend a lot of time editing configuration files, but > most people don’t realize how portable they are and how long they remain > useful. The cost of customizability is amortized over years, not months. The > cost of setting up a new workstation is near-zero. I keep all my configs in an svn repo on this machine, so here's all the fun stuff: * [~/.xinitrc](http://phraktured.net/config/.xinitrc) I usually start X with [slim](http://slim.berlios.de/) or startx. Both of these commands read a user-based ~/.xinitrc. This one is small, so it's here: #!/bin/sh xmodmap ~/.xmodmap xset m 2 1 #this will keep the clipboard in sync # with the selection buffer #autocutsel -selection CLIPBOARD -fork tpb & #thinkpad button handler (with xosd output) mpd & #moosics! #just in case scaling the BG fudges at the edges, make them black xsetroot -bg black eval $(cat ~/.fehbg) exec ratpoison * [~/.bashrc](http://phraktured.net/config/.bashrc) My bashrc is fairly complicated. I have a handful of functions that I should probably break out into ~/bin/ scripts. All-in-all, there's not really much there. Though [~/.inputrc](http://phraktured.net/config/.inputrc) is probably fairly important as well. Here's a little excerpt I posted to mark's blog, about letting bash set screen's window title automatically. #special screen-specific stuff for window titles case $TERM in screen*) trap 'echo -ne "\ek${BASH_COMMAND%%\ *}\e\\"' DEBUG PROMPT_COMMAND='echo -ne "\ek$(short_pwd 15)\e\\"' ;; esac Note that the `trap` line sets screen's title to the command I'm running, and the `PROMPT_COMMAND` line sets the title to the current dir when at the prompt. short_pwd is similar to vim's pathshorten() function used in tab names - well, the output is, at least. * [~/.vimrc](http://phraktured.net/config/.vimrc) Set the switch to More Magic. Like the other guys (though they appear to use emacs), my vimrc has grown up over time, and has many little if/else cases for different terminals/OSes and just about every setting I like. The only changes I make anymore are to global plugin settings. I should make it a point to say that vim's "wildmenu" is a must-have for tab completion on the `:command line` set wildchar= set wildmenu set wildmode=longest:full,full * [~/.ratpoisonrc](http://phraktured.net/config/.ratpoisonrc) Not much to say here. It's almost all keybindings. Note that the multimedia key bindings take the place of mark's 'nowplaying' + ncmpc usage A bit interesting: I use windows at work, so it's hard to break the Alt-Tab usage... here's the bindings for ratpoison: definekey top M-Tab next definekey top M-ISO_Left_Tab prev * [~/.screenrc](http://phraktured.net/config/.screenrc) A bit longer than the other two use, but I abuse the hardstatus line for a "system monitor". This is the only really non-portable config file I keep, because screen doesn't have a good "if/else" mechanism to allow different settings depending on the machine. Here's something fancy. Because I never use urxvt without screen running, I've bound S-PgUp and S-PgDn in urxvt to sent invalid escapes (the terminal does nothing but spit out gobbledygook). I then map these escapes in screen to enable simplified scrolling through screen's copy mode. #let pgup/pgdn scroll under urxvt (see .Xdefaults) bindkey "^[[5;2~" eval "copy" "stuff ^u" bindkey -m "^[[5;2~" stuff ^u bindkey -m "^[[6;2~" stuff ^d * [~/.Xdefaults](http://phraktured.net/config/.Xdefaults) All my colorful fancy urxvt settings (and a few for Xpdf) are held here. Just some important notes. urxvt's perl extensions are fabulous. For instance, `matcher` can match text patterns and make clickable links out of them. By default, it's setup to handle URLs and launch them with urlLauncher. urxvt*perl-lib: /usr/lib/urxvt/perl/ urxvt*perl-ext-common: default,matcher,searchable-scrollback urxvt*urlLauncher: /opt/mozilla/bin/firefox urxvt*matcher.button: 1 Also, just a note. The above simple-scrolling in screen is done with these two: urxvt*keysym.S-Prior: ^[[5;2~ urxvt*keysym.S-Next: ^[[6;2~ There's much more over at http://phraktured.net/config - feel free to check it out.