An Updated Version of sam

Sam is an innovative text editor written by Rob Pike in the early 1980s for Bell Labs Research Unix for the Blit windowing terminal, and later ported to Plan 9 from Bell Labs and later still back to Unix using the X Window System.

Sam is available today as part of Plan 9 from User Space, but to really use that version requires installing a fair amount of additional code. The version presented here is based on the original (?) po
Screenshot of sam with scalable fonts
rt to X from 1989 and has no requirements other than Xlib and freetype, both of which are universally available on modern Linux, BSD, Unix, and Unix-like systems that use X. If you want to run sam  without installing a bunch of other stuff, this might be what you're looking for.

This version has several differences (some might call them "enhancements", others might hate them) over the original Unix port:
  • Support for scalable fonts. Running sam with Inconsolata is a joy.
  • The ability to control a remote sam session from the remote machine as well as the local machine. This makes sam much more usable when working on a remote machine via SSH: the B command can be invoked on either system!
  • A simple, configurable mechanism for Unicode input modelled on the Plan 9 version.
  • A configuration mechanism based on environment variables, not X resources.
  • More keyboard support: you can move the cursor and jump between the command window and the current file using keystrokes. This means you can use execute a command on the current file without taking your hands off the keyboard!
  • Support for two-button mice (shift-button-3 is treated as button-2).
  • An updated and extensive manual page in mdoc(7) format.

Note that if you want the "full sam experience" with plumbing and other stuff, you might want to consider Plan 9 from User Space. However, if you just want to run the editor, try this out first. Note that I haven't tested this on any system other than Linux, but it shouldn't be too hard to get it working on any POSIX-y system with X11.

Also, obviously, this software is provided with absolutely no warranty either expressed or implied, and the user assumes all risk. No other person was responsible for the changes I made; specifically none of the original authors were involved in making these changes and were not consulted and probably don't even know about it (yay open source!).

The source code for this version of sam can be downloaded from Github. Installation is generally simple: edit to point to the correct installation paths and fire away. Remember, if anything breaks, it's not my fault.

There are other people out there who love sam, and have pages about it. Check out

Please send any comments, questions, suggestions, or patches to