I read UNIX as literature (by Thomas Scoville) today as a break from hacking on some mysql-fuelled matplotlib data visualization. Although I appreciate text and its ease of expressive power, UNIX remains a thinking person's OS largely because you really can completely destroy things easily $(sudo dd if=/dev/zero of=/dev/hda), while providing you turing-complete tools to bend the machine to your will.

That said, I do live primarily in a text world. I probably spend over 90% of my time in X split between firefox and an xterm with screen. Plain old xterm has a bunch of hidden capabilities in its xresources that I like.

  1. Auto-complete any word on your screen
  2. Redefine the double-click to highlight a regexp
  3. Heck, redefine what any keypress or mouse action means

The auto-complete rocks. As long as the url/filename/word still exists in your scrollback history, you can use dabbrev-expand() to complete it. In the xresources below, I have it mapped via Shift+Tab.

The default xterm double-left-click just selects alphanumerics, so double-left-click won't select email address, URLs, or filenames. The character class below maps out a better definition of a word to include URL valid characters, leaving out parentheses, braces, quotes, and whitespace. ! ! after editing this, run: xrdb -merge ~/.Xresources ! to debug, use $(xrdb -query) or $(appres) ! ! to input a return, get the hex value from $(xmodmap -pk | grep -i return) ! www.klauser.ch/lxug/ch12.pdf xterm*translations: #override \ !Ctrl <Key>=: larger-vt-font() \n\ !Ctrl <Key>-: smaller-vt-font() \n\ !Shift <Key>Tab: dabbrev-expand() \n ! ! !Shift <Key>Tab: string("my_crzy_long_email_address@stupid_provider_in_hell.com") insert(0xff0d) \n\ ! !Shift <Key>Tab: insert-selection(CLIPBOARD) \n\ ! ! when you double-click a word, this defines the "word" ! from http://www.leidinger.net/X/xresources/app-defaults/XTerm_mascheck xterm*charClass: 35-38:48,43-47:48,58-59:48,61:48,63-64:48,126:48 xterm*on2Clicks: word xterm*on3Clicks: regex [^>#\n]+ xterm*on4Clicks: group ! ! truetype font setup xterm*faceName: 'andale mono' xterm*faceSize: 11 ! scale fonts up nicely using Ctrl-Right-Click or the translations above xterm*faceSize1: 12 xterm*faceSize2: 14 xterm*faceSize3: 18 xterm*faceSize4: 20 xterm*faceSize5: 25 xterm*faceSize6: 30 ! ! go minimalist, black on a white background ! instead of reverse, highlight with red xterm*foreground: rgb:00/00/00 xterm*background: rgb:ff/ff/ff xterm*highlightColor: rgb:ff/00/00 xterm*highlightTextColor: rgb:00/00/00 ! ! other usability xterm*scrollBar: false xterm*loginShell: true xterm*saveLines: 2048