How to use ExtDiff extension of Mercurial

Mercurial is very convenient to use at the commandline. However, there are certain operations that are better with the GUI. For example, I prefer to use a GUI to go through the diff of uncommitted changes. The ExtDiff extension can be used to launch a GUI Diff tool to view the diff of a single file or across the entire repository.

  • To enable the ExtDiff extension, add this line to your hgrc:
[extensions]
hgext.extdiff =
  • To view the diff of a particular file using a GUI diff program, for example meld:
$ hg extdiff -p meld src/bar/foo.cpp
  • To view the diff of all uncommitted files using a GUI diff program, for example meld:
$ hg extdiff -p meld

Make sure that the GUI diff program you use has the ability to show the diff of multiple files in a directory hierarchy.

  • If you want to always launch a particular GUI diff program, then it is better to add a custom command for it. For example, to launch meld using a new command named vdiff, add this line to your hgrc:
[extdiff]
cmd.vdiff = meld

After this, you can view the diff using the vdiff command:

$ hg vdiff src/bar/foo.cpp
$ hg vdiff

Tried with: Mercurial 2.8.2 and Ubuntu 12.04

How to use Churn extension of Mercurial

The Churn extension is useful to have on repositories shared by many authors. It shows a simple histogram of committed changes, along with author name.

  • To enable the Churn extension, add this line to your hgrc:
[extensions]
churn =
  • Using churn is straightforward:
$ hg churn
joe@mac.com 800 ********************************
foo@foo.com 420 *****************

Tried with: Mercurial 2.8.2 and Ubuntu 12.04

How to use Shelve extension of Mercurial

The Shelve extension of Mercurial is useful to temporarily store away your uncommitted changes and then restore them back. For example, if you are working on some changes, and before you commit it, someone comes in and asks you to test something on an earlier version. You can shelve away your changes, finish the testing and unshelve the changes and continue.

  • The Shelve extension needs Mercurial 2.8 or later. If you have an older version of Mercurial, install the latest version.

  • If your Mercurial installation does not include the Shelve extension, it can be installed from PyPI using PIP:

$ sudo pip install hgshelve
  • Enable the extension by adding this line to your hgrc:
[extensions]
shelve =
  • To shelve your uncommitted changes:
$ hg shelve

It will be stored using the name default. You can provide other names if you wish.

  • To unshelve these changes later:
$ hg unshelve

Tried with: Mercurial 2.8.2 and Ubuntu 12.04

StayFocusd extension for Chrome

StayFocusd is one of the best Chrome extensions to block distracting websites while you work. It can be installed from here.

The options in StayFocusd are a bit different from other website-blocking extensions. However, once you learn about them, you wish other extensions had these features too.

  • Max time allowed: This is amount of time you are allowed to view the blocked websites in a day. By default, this is 10 minutes.

  • Active days: Choose the days of the week when you want StayFocusd to block websites.

  • Active hours: The hours of the day when StayFocusd should block websites.

  • Blocked sites: Here you can add the website domains which you would like to be blocked.

In addition to these settings, it is a good idea to enable the extension to work in Incognito Mode too.

Tried with: StayFocusd 1.4.7 and Chrome 31.0.1650.63

How to enable Chrome extension in Incognito Mode

Don’t you wish a few of your regular Chrome extensions worked in Incognito Mode? Actually they can! This awesome little option is available in plain sight and I had missed it for so long.

Go to Settings > Extensions. In the list of installed extensions, you can see the Allow in incognito checkbox available below each extension. Enable it for the extensions you want and you are done! 🙂

Tried with: Chrome 31.0.1650.63 and Ubuntu 12.04

HoverZoom extension for Chrome

HoverZoom is one of those Chrome extensions that you wonder how you lived without! This is because a lot of images are shared today using links, like on Twitter. Most websites, like Facebook, show small size images which need to be clicked to view the full size image. HoverZoom makes viewing the full-size image hidden behind links and thumbnails a piece of cake.

On hovering the mouse cursor over any link or image, HoverZoom downloads the full size image and displays it. There is no need to click anything, which reduces the friction of using this operation.

Tried with: HoverZoom 4.29, Chrome 31.0.1650.63 and Ubuntu 12.04

BibTeX Entry from URL Chrome Extension

Adding BibTeX entries and citations to internet URLs is quite a pain in LaTeX. Manually creating the BibTeX entry can get cumbersome. If you find yourself adding a lot of links from the web to your LaTeX document, then try the BibTeX Entry from URL extension for the Chrome browser.

After you install it, it adds a button beside the addressbar. On a webpage that you want to add to your LaTeX document, just click this button and a BibTeX for that link is added to your clipboard. A sample entry looks like this:

@online{Anand3:Online,
    title = {AnandTech | Motorola Moto G Review},
    url = {http://www.anandtech.com/show/7586/motorola-moto-g-review},
    note = {(Visited on 01/11/2014)}
}

Paste this BibTeX entry into your .bib file and cite it in your .tex file just as you normally would and you are done! 🙂

Tried with: BibTeX Entry from URL 1.2.1, Chrome 31.0.1650.63 and Ubuntu 12.04 LTS

StackCodeExpander extension for Chrome

If you spend a lot of time looking at code at StackOverflow or Github, you might want to try the StackCodeExpander extension for Chrome. The code in these websites can be long in width and run off the page, requiring you to drag scrollbars. This extension adds a button at the top-left corner of such code snippets. Click it and the code is shown on a new page, so that you can read it with focus.

Tried with: StackCodeExpander 0.1.2 and Chrome 31.0.1650.63

Decreased Productivity extension for Chrome

Open plan offices are getting popular at workplaces now. One problem of this setup is that almost any webpage you open looks distracting to someone passing by. Even technical webpages have bright colors, huge photos and advertisements.

Decreased Productivity is a great Chrome extension for browsing in such a work environment. It removes all the colors and photos from a webpage showing it as simple black text on white background. It has lots of settings where you can choose how it should hide the webpage content and which elements to hide. To get started, just install the extension and click the coffee cup icon it adds to the addressbar.

Tried with: Decreased Productivity 0.46.34 and Chrome 31.0.1650.63

VsVim extension for Visual Studio

The VsVim extension brings Vim key bindings and interface to Visual Studio. This is similar to the Vrapper plugin for Eclipse.

Installing VsVim is straightforward. Go to Tools > Extension Manager. Choose Online Gallery and search in the top right box for VsVim. Choose VsVim from the search results and click Install. Once install is done, restart Visual Studio.

VsVim adds its own bar at the bottom of the editor window. This is used to display the Vim commands you type and their results. There are many common Vim commands that have pre-defined bindings in Visual Studio. You can pick and choose which of these you want to retain with Visual Studio or grab for Vim. This can be done by clicking the Options button in the bottom VsVim bar.

If you want to look at the VsVim source code or help add a feature, go to its Github page.

Tried with: VsVim 1.4.2.0, Visual Studio 2010 and Windows 8 x64