I had some automatically code generated files that I wanted to mark as read-only. I knew it was possible to flag a file as read-only in both emacs and vim. However, I found it really hard to Google for the exact syntax.
In Vim, the flags go in the file's …