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.)

Source: http://stackoverflow.com/questions/230718/redirection-and-vim

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:

[hooks]
commit.autopush = hg push

Source: http://stackoverflow.com/questions/1235597/mercurial-automatic-push-on-every-commit