DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Define Command Alias in Windows Console


In cmder, turn on "Use legacy console" in [Properties > Options] in Windows console window. See Aliases not working at all for details.

Then add vi=vim $* into C:\apps\cmder\config\user-aliases.cmd.

Here you must add $* after origin command, or vi myfile will be transformed to vim.

My aliases definition:

l=ls --show-control-chars -F --color -la $*
ll=ls --show-control-chars -F --color -l $*
ls=ls --show-control-chars -F --color $*

pwd=cd
clear=cls
history=cat "%CMDER_ROOT%\config\.history"
cd=cd $*$Tautojump -i $Gnul
unalias=alias /d $1
cmderr=cd /d "%CMDER_ROOT%"

vi=vim $*
g="C:\Program Files (x86)\Vim\vim80\gvim.exe" $*
np="C:\Program Files (x86)\Notepad++\notepad++.exe" $*

gs=git status
ga=git add -A
gd=git diff $*
gl=git log --stat --decorate $*
glg=git log --graph --abbrev-commit --decorate --format=format:'\''%C(bold blue)%h%C(reset) - %C(bold cyan)%ai%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'\'\''          %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'\'' --all
gci=git commit $*

dn=powershell -f C:\apps\cygRoot\home\lee_c\apps\dsnote\donshell.ps1 $*


Published

Jul 2, 2017

Last Updated

Jul 2, 2017

Category

Tech

Tags

  • alias 3
  • cmder 2
  • windows 67

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor