Windows 10 - Setup Cmder
Tags: cmder, windows
Published: 2020-05-26 20:14:55

---
title: "Windows 10 - Setup Cmder"
published: true
description: "Cmder a command console for windows."
tags: ["cmder", "windows"]
canonical_url: https://kags.me.ke/post/cmder-commander-console-for-windows/
---

![Alt "cmder root environment variable setup"](https://dev-to-uploads.s3.amazonaws.com/i/no430iaxg9htojkwllt2.png)

### What is Cmder

Cmder is a commander console for Windows. The opening line on [Cmder's website](https://cmder.net/) explains it all.

> Cmder is a software package created out of pure frustration over the absence of nice console emulators on Windows. It is based on amazing software, and spiced up with the Monokai color scheme and a custom prompt layout, looking sexy from the start.

All the magic of Cmder happens through use of [ConEmu](https://conemu.github.io/) - a console program for windows and [Clink](https://mridgers.github.io/clink/) which gives it a powerful bash style command line editing, completion, history and much more.

### Features

Cmder packs a huge list of features and the following are some highlights of the available features:

- Implements Git for Windows
- Very portable. It designed with no external dependencies. You can just package it in a folder, put it on a USB stick and use it from anywhere on any system
- Look and Feel. Has a wide range of customizable themes (color schemes) you can choose from
- Offers powerful customization options
- Has awesome shortcuts which makes you much more productive making your life easier
- Makes it simple to copy and paste with multiple methods of doing it such as **Ctrl+C** and **Ctrl+V**
- Has syntax highlighting for things like bash scripts and git repository folders
- Multiple tabbed consoles with an option of renaming the tabs to give you better context. Tabs can be configured to appear at the top instead of bottom which is the default
- Allows creation of custom tasks which you can run by name or hot key
- Powerful search capabilities with a search box built right into the interface
- allows use of Unix commands like `ls`, `rm`, `chmod`, `curl` ,`ssh`, `vim` and many more.

### Installation

To install, visit [Cmder](https://cmder.net/) website and under the downloads section, download either the mini or full version. The full version includes Git for Windows.

After downloading, extract the archive to a local folder that would not require Administrator access for modifying the configuration files. In this article, lets extract intto _C:\MyApps\Cmder_ folder. The location where you have extracted the files will be the **CMDER_ROOT**. Navigate to the folder where you have extracted the files and open **Cmder.exe**.

### Setup CMDER_ROOT, %ConEmuDir% and %PATH% Environment Variables

- Within Windows, search for **environment variables** and click **Edit the system environment variables** to open
- When the **System Properties** window opens, click on **Enviroment Variables** button.
- Below **System variables** section, click **New...** button
- Under **Variable name**, type **CMDER_ROOT** and within **Variable value:** type or browse to your Cmder root installation folder and click OK to go back to the **Environment Variables** window.

![Alt "cmder root environment variable setup"](https://dev-to-uploads.s3.amazonaws.com/i/iubihafrnx8hoggzgx88.png)

- Click the **New...** button again to setup **%ConEmuDir%** environment variable. Use following values:
  - Variable Name: **%ConEmuDir%**
  - Variable values: **[cmder_root]\vendor\conemu-maximus5**

![Alt "conemu environment variable setup"](https://dev-to-uploads.s3.amazonaws.com/i/6m885k6jmum9f6du4oii.png)

- Click OK button to save the changes.
- To update the PATH variable, select **PATH** under **System variables** and click **Edit...**
- Click **New** button to and type or browser location for the Cmder folder and click OK to save the changes and click OK.

![Alt "Path environment variable setup"](https://dev-to-uploads.s3.amazonaws.com/i/d5ghvngy68yr66x4sop7.png)

- Click OK another two times to close the previous opened dialogs
- Restart the computer in order for the new PATH changes to take effect
- Open command prompt (cmd.exe) and type `where cmder`. Your results should display the full path to the Cmder.exe.

![Alt "cmder where location command"](https://dev-to-uploads.s3.amazonaws.com/i/d6d5s16lyk66khfcoqfk.png)

### Cmder Settings

Cmder has many settings that can be configured. Here we look at how to change settings for two of the available settings.

- Open Cmder, click on Cmder icon on top left corner of the window and select **Settings**
- To have opened tabs appear at top the window instead of the bottom which is the default, under **General** click on **Tab bar** and un-check **Tabs on bottom**
- To change theme, select **Features**, **Color** and either change colors to your liking or select from under **Schemes**

![Alt "cmder settings screen"](https://dev-to-uploads.s3.amazonaws.com/i/mias3nmbox680hyl7dih.png)

### Launch Cmder from **cmd.exe**

- Create a _cmder_shell.bat_ with the following contents:

```bash
@if "%cmder_init%" == "1" (goto :eof) else (set cmder_init=1)
@pushd %CMDER_ROOT%
@call "%CMDER_ROOT%\vendor\init.bat" /f
@popd
```

- Save the file to Cmder installation folder
- Open Windows **cmd**, type **cmder_shell** and press the **ENTER** key. This will open the Cmder's shell within the CMD window.

### Add Cmder shell to AutoRun

- Open RegEdit.exe
- Navigate to **HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor**
- Right click **Command Processor** and select **New** > **String Value**.
- Change the **New Value** name to **AutoRun**
- Right click on the **AutoRun**, select **Modify** and set value to **cmder_shell.bat** and click OK
- Close the Registry Editor

![Alt "cmder registry autorun key"](https://dev-to-uploads.s3.amazonaws.com/i/diyawpqmlzslm6rx5gw8.png)

  Now every time you open the CMD.EXE, you'll have the Cmder shell in your terminal

### Context Menu Integration

- Open a CMD terminal as an Administrator
- Navigate to the directory you have place CMDER
- Execute `.\cmder.exe /REGISTER ALL`
- In a file explorer window right click on any directory and you should see **Cmder Here** in the context menu.

### Integrating VS Code Terminal

- Open VS Code
- From the menu select **File** > **Preferences** and click on **Settings**
- Search for **settings.json**
- Click **Edit in settings.json**
- Append the following into your configuration file. Make sure to replace **[cmder_root]** and **%CMDER_ROOT%** with the actual Cmder root path.

```json
  "terminal.integrated.shell.windows": "cmd.exe",

  "terminal.integrated.env.windows": {
  "CMDER_ROOT": "[cmder_root]"
  },
  "terminal.integrated.shellArgs.windows": [
    "/k",
    "%CMDER_ROOT%\\vendor\\bin\\vscode_init.cmd"
  ],
```

- Close and re-open VS Code. From the menu, Select **View** from the menu and click on **Terminal**.

### Setting up Aliases

You can define simple aliases with a command like `alias name=command`. Aliases support optional parameters using `$1-9` or `$*` characters. User aliases are defined and stored in _%CMDER_ROOT%\config\user_aliases.cmd_ file.

_cmderr_ is default alias for changing directory to the defined cmder_root. If you have setup the environment variable, open a cmder terminal and type `cmderr` and press the ENTER key. This should take you to the root directory of Cmder. To append more aliases to the file, open the file using your favoured editor and add any aliases you may requirre.

One alias that I frequently use is the tilde (~) to navigate to my home directory. The alias is defined using `~=cd "C:\\Users\\Kagunda JM"`. Always remember to double quote paths which have spaces.

After you have defined your aliases, restart the terminal for the changes to take effect. Thereafter, you can start using the aliases to perform those repetitive tasks.

![Alt "Cmder user aliases file"](https://dev-to-uploads.s3.amazonaws.com/i/u8fgqdzfwifu9ye6j7je.png)


### Resources

- [Cmder](https://github.com/cmderdev/cmder#shortcut-to-open-cmder-in-a-chosen-folder)
- [Cmder's shell in other terminals](https://github.com/cmderdev/cmder/wiki/Cmder's-shell-in-other-terminals)
- [Seamless VS Code Integration](https://github.com/cmderdev/cmder/wiki/Seamless-VS-Code-Integration)