Fix compilation on Mac OS X

The `printf` command on Mac OS X ignores variable substitutions (or something
like that) on printf strings beginning with `--`.
Add common text editor files and OS indices to the gitignore