Setting up Windows Command Line

The command-line uses:

  • TCC/LE (or clink) for a better cmd.exe
  • unixy commands from git bash.
  • ConEmu for a tabbed terminals.

CLink is a better cmd.exe. By default ConEmu will automatically attach it a cmd.exe window, use the ConEmu setting to configure this option.

The bash-style (readline) tab completion is why I currently prefer clinku to TCC/LE.

ConEmu Config

Show the folder name in the tab title:

  • Tab bar -> Console: %f

Hide windows border:

  • Main -> Appearance -> Hide Caption always

Clean up tab bar:

  • Show search field in tab bar: Uncheck

Terminal colors

Now we want to customize our unixy commands, something like:

alias ls=ls $* --color 
alias ll=ls $* -l --color 

We can set the alises in our shell of choice or ConEmu. Since I am not sold on either TCC or CLink, I will use ConEmu. In the ConEmu settings find the Startup -> Environment tab and add the alises.

Terminal Prompt

Since I never switch computers or users on windows I use this prompt:

set PROMPT=$E[92m$P$E[90m$_$E[90m$G$E[m$S

To apply the new prompt setting:

  • Make a copy of the default CmdInit.cmd (put it in your home)
  • Modify the prompt setting
  • Use the new CmdInit.cmd for default terminals.

Startup directory

To change the initial directory use the command in ConEmu:

cmd.exe /k "c:\cwebber\CmdInit.cmd" -new_console:d:C:\cwebber

Or add the following to Task parameters:

/dir "c:\cwebber"

vim settings

These are completely personal. Add this to the _vimrc file.

set tabstop=4
set shiftwidth=4
set expandtab
colors slate

Unixy commands

You can get the familiar set of unix commands (grep, find, du) from Git Bash. The GnuWin32 coreutils package has nearly the same set of commands. Since Git is going on the machine we might as well use that.

Add the git\bin directory to your %PATH%

Links to applications

I like to call to add batch files to the c:\bin directory instead of extending the %PATH%. Probably because keeping the %PATH% clean is a pain in the neck.

$ more c:\bin\gvim.bat
@echo off
start /b "dummy" "C:\Program Files (x86)\Vim\vim74\gvim.exe" %*

$ more c:\bin\npp.bat
@echo off
start /b "dummy" "C:\Program Files (x86)\Notepad++\notepad++.exe" %*