Now that I’ve jumped fully on board the Git and GitHub bandwagon, I’m spending a lot more time at the command line. In fact, I find myself working with both Visual Studio and the command prompt simultaneously, constantly switching back and forth between the two. The main reason is that, while Visual Studio 2013 makes a great Git client and tools such as TortoiseGit are a great help, there are some Git commands, like stash and rebase, that either aren’t supported well by the tools or are just easier to perform at the command line. Besides, most of the online Git tutorials list Git commands.
DOWNLOAD Cmder here: https://github.com/cmderdev/cmder.
Another reason why I find myself more on the command line is that I’m working with ASP.NET 5, which requires the use of a command prompt for managing versions of the runtime and generally embraces command line tools as a first class citizen. Finally, there’s Chocolatey, for easily installing tools at the command line, and, of course, PowerShell for automating actions with scripts.
As my need to work at the command line has increased, so has my frustration with the standard windows command prompt. Thankfully, I’ve run across a very nice command prompt replacement called Cmder, which combines the console emulator, ConEmu, with cmd enhancements from Clink and Git support from msysgit. In short, it’s the one command prompt you’ll ever want to use.
If for no other reason, Cmder will win you over with its support for ^C and ^V for Copy and Paste. A list of basic commands can be found here, and you can execute a command to add file explorer integration, so that you can right-click on a directory to see “Cmder Here” in the context menu (open an administrator prompt at the Cmder installation directory and execute .\cmder.exe /REGISTER ALL).
I much prefer using Cmder for all my git command-line tasks rather than opening a Git Bash prompt, because all the standard cmd.exe commands are there, and it shows both the repo location and current branch. Here you can see I’m at a local Git repo on the master branch, then I list all the branches and checkout the develop branch.
And here you can see an example of executing ASP.NET 5 commands, such as dotnetsdk (aka kvm).
There are some fancy things you can do with Cmder, including basic unix commands (such as ls, mv, cp, grep, cat) and aliases, which are shortcuts you can define in a text file (located in config\aliases) for common tasks. For example, there’s a built-in alias for the Windows file explorer. Simply type .e, and an explorer window opens at your current location.
Besides its versatility, what I especially like about Cmder is the ConEmu goodness that comes with it. It’s easy to set up predefined tasks that open additional tabs in the same Cmder window so you can switch between them by pressing Ctrl+Tab and Ctrl+Shift+Tab. You can also assign each task a hot key. To set up tasks, just click on the dropdown arrow to the right of the green plus icon in the lower right-hand corner.
Selecting “Setup tasks…” from the menu will display a dialog for configuring ConEmu settings. From here you can click “Add default tasks,” then tweak the commands that were inserted. This will allow you to open new tabs for an administrator prompt, PowerShell, Chocolatey and Git Bash, among others.
Another thing you can do at this dialog is to assign a different palette (color scheme) for different commands. For example, it would be nice for the Admin prompt to show up with a slightly different color scheme to give you a visual queue as to which console you’re on, and it would be just as nice for the PowerShell console to light up with the standard PS colors. To do that, you can select Features / App distinct, then add application distinct settings which override the default color palette.
Executing the PowerShell Admin task will, for example, open a new elevated Cmder tab colored in the same way as the standard PS prompt.
Lastly, after making these customizations you’ll want to export the settings file. If you want to use the settings file I created for my own use, you can get it here. Better yet, you can copy the entire cmder folder to a USB stick or a cloud service, such as DropBox, where you can use it from any connected machine. Enjoy!