Friday, September 23, 2011

Vim: Reading from stdin

Here is a neat tip for Vim.

To read from stdin use
<other commands> | gvim -R -

-R instructs Vim to read the file in read-only mode.
- is a utility convention that means open from stdin. (See Guideline 13 of Utility Syntax Guidelines from the Posix standard.)


Sunday, September 18, 2011

Mercurial: Automatically pushing changes on commit

Here is a neat tip for Mercurial.

To automatically push on every commit add this hook to your repo hgrc:

commit.autopush = hg push