chris blogs: February 2008

29feb2008 · 10 zsh tricks you may not know...

…yet, that is. Or if you do, you read the man page pretty well. :-)

zsh has gazillions of features, but I think these are pretty useful for daily use:

  1. ESC-. inserts the last argument of the previous history line, repeat to go back in history. (Same in Bash.)
  2. ESC-' quotes the whole line. (Useful for su -c or ssh).
  3. ESC-q clears the line and inserts it again on the next prompt, allowing you to issue an interim command.
  4. <(command) returns the filename (in /dev/fd if supported or as a FIFO) of the pipe given by command for reading. (For example, use diff <(ruby foo.rb) <(ruby-1.9 foo.rb) to compare two program outputs).
  5. cd old new substitutes old with new once in the pwd and chdirs there.
  6. !$ expands to the previous history line’s last argument, !^ expands to the first argument, !:n to the n-th argument.
  7. =foo expands to the full path of foo in the PATH (like which foo).
  8. for src in *.c do ... done can be abbreviated to for src (*.c) { ... } (which is actually memorizable). You can even drop the curly braces if you don’t have ; in the command.
  9. <42-69> globs numbers between 42 and 69. Drop the number(s) to make it open-valued. {42..69} expands to the numbers between 42 and 69.
  10. *** expands recursively like **, but follows symbolic links.
  11. Addition! ESC-RETURN inserts a literal newline, so you can edit longer commands easily.

More tricks:

Happy hacking.

NP: Shriekback—Mistah Linn He Dead

26feb2008 · Sentia: My OLPC

After two months of hassle, finally my OLPC got though German customs.

Sentia, my OLPC

Sentia was the goddess who oversaw children’s mental development. It is also said it was the goddess who gave awareness to the young child.

Tweaks I did and will do are, as usual, on vuxu.

It’s a really nice thing, but it wouldn’t hurt if it was quicker and had more RAM.

NP: DJ Acucrack—Return of the Optimizer

04feb2008 · Introducing gitsum

The major showstopper before I was seriously considering going to Git was the lack of an darcsum-like interface for Git.

Yesterday night I finally decided to write it.

git-status (included as git.el in the Git distribution) is usually good enough to use, but I often like to do partial commits, that is, commit only parts of a file. Git can do that now for some time, using git add --interactive or frontends like git-hunk-commit or git-wt-add. Still, there was no way to do it conveniently in Emacs.

Let me introduce gitsum:

Gitsum screenshot

You can freely delete hunks you don’t want to commit, split big changes, or even edit the patch directly if you feel adventurous. It also integrates into git-status so you can easily switch between these frontends.

Gitsum is hosted at (which I highly recommend) and is mirrored at, patches and additions are welcome! It’s still very fresh and has some rough corners, but I already notice my increase in productivity.

NP: Twelve Tone Failure—As I Hit the Floor

Copyright © 2004–2016