cmder 是一款 windows 下的命令集合软件,它可以集合各种系统下的命令,并且操作非常快速方便。 安装有两个版本,一个是简化版(4.27M),一个是完全版(75.7M),它们的唯一区别:完全版包含 git-for-windows,如果你已经装了 git-for-windows,直接下载简化版就好。 cmder 没有安装文件,直接下载解压文件,运行 Cmder.exe。
如果我们想 win+r “运行”中输入 cmder 来启动,需要在系统环境变量中添加路径,如下:
添加到右键命令(需要运行管理员权限):
Cmder.exe /REGISTER ALL
快捷键方式:
Ctrl + T : New tab dialog (maybe you want to open cmd as admin?)
Ctrl + W : Close tab
Ctrl + D : Close tab (if pressed on empty command)
Shift + Alt + #Number : Fast new tab: 1 - CMD, 2 - PowerShell
Ctrl + Tab : Switch to next tab
Ctrl + Shift + Tab : Switch to previous tab
Ctrl + #Number : Switch to tab #Number
Alt + Enter: Fullscreen
在使用gitlog的时候会出现汉字编码问题,
在 Settings > Startup > Environment 里添加:
set LANG=zh_CN.UTF8
刚刚安装最新版的win10,发现cmder有个问题,就是新版的光标前面总有一个空格
解决方法:
打开cmd,对其最上栏进行右键
修改为旧版控制台即可!
更改提示符:
默认的为λ,改成常用的$
打开\cmder\vendor目录下面的clink.lua文件,搜索λ,全部替换成$即可!
添加别名:
在cmder->config->user-aliases.cmd,打开,添加别名
l=ls --show-control-chars
la=ls -aF --show-control-chars
ll=ls -al --show-control-chars --color $*
.. = cd ..
... = cd ../..
.... = cd ../../..
..... = cd ../../../..
gpl=git pull origin $1
gps=git push origin $1
mccm=mvn clean compile -Dmaven.test.skip=true
mcpm=mvn clean package -Dmaven.test.skip=true
mcim=mvn clean install -Dmaven.test.skip=true
mccmc = mvn clean compile -Dmaven.test.skip=true --settings C:\Users\qhong\.m2\settings_dev.xml
mcpmc = mvn clean package -Dmaven.test.skip=true --settings C:\Users\qhong\.m2\settings_dev.xml
mcimc = mvn clean install -Dmaven.test.skip=true --settings C:\Users\qhong\.m2\settings_dev.xml
mccs=mvn clean compile -DskipTests
mcps=mvn clean package -DskipTests
mcis=mvn clean install -DskipTests
mccsc = mvn clean compile -DskipTests --settings C:\Users\qhong\.m2\settings_dev.xml
mcpsc = mvn clean package -DskipTests --settings C:\Users\qhong\.m2\settings_dev.xml
mcisc = mvn clean install -DskipTests --settings C:\Users\qhong\.m2\settings_dev.xml
sudo=ConEmuC -c $* -new_console:a
vscode = "D:\Program Files\Microsoft VS Code\Code.exe" $1
idea = "D:\Program Files (x86)\JetBrains\IntelliJ IDEA 2018.1\bin\idea64.exe" $1
上面的$1,指的是命令后面加的参数
还可以设置终端代理:
setall=set ALL_PROXY=socks5://%IP%:%PORT%
sethttps=set https_proxy=https://%IP%:%PORT%
sethttp=set http_proxy=http://%IP%:%PORT%
usall=set ALL_PROXY=
ushttps=set https_proxy=
ushttp=set http_proxy=
设置环境变量IP,PORT,分别为代理的ip和端口
;= @echo off
;= rem Call DOSKEY and use this file as the macrofile
;= %SystemRoot%\system32\doskey /listsize=1000 /macrofile=%0%
;= rem In batch mode, jump to the end of the file
;= goto:eof
;= Add aliases below here
e.=explorer .
ls=ls --show-control-chars -F --color $*
pwd=cd
clear=cls
history=cat "%CMDER_ROOT%\config\.history"
unalias=alias /d $1
vi=vim $*
cmderr=cd /d "%CMDER_ROOT%"
l=ls --show-control-chars
la=ls -aF --show-control-chars
ll=ls -al --show-control-chars --color $*
..=cd ..
...=cd ../..
....=cd ../../..
.....=cd ../../../..
su=ConEmuC -c $* -new_console:a
vscode="D:\Program Files\Microsoft VS Code\Code.exe" $1 --disable-gpu
idea="D:\Program Files (x86)\JetBrains\IntelliJ IDEA\bin\idea64.exe" $1 --disable-gpu
zkc=zkCli.cmd -server $1
chcp9=chcp 936
chcp6=chcp 65001
kpid=taskkill /pid $1 /f
kpname=taskkill /f /t /im $1.exe
netshii=netsh i i show in
netshiis=netsh interface ipv4 show neighbors
netshiid=netsh i i dump
netshiidn=netsh i i delete neighbors
netshiir=netsh i i reset
setproxy=set ALL_PROXY=socks5://127.0.0.1:1080
setall=set ALL_PROXY=socks5://%IP%:%PORT%
sethttps=set https_proxy=https://%IP%:%PORT%
sethttp=set http_proxy=http://%IP%:%PORT%
usall=set ALL_PROXY=
ushttps=set https_proxy=
ushttp=set http_proxy=
mcm=mvn compile -Dmaven.test.skip=true $1
mpm=mvn package -Dmaven.test.skip=true $1
mim=mvn install -Dmaven.test.skip=true $1
mcmc=mvn compile -Dmaven.test.skip=true --settings C:\Users\qhong\.m2\settings_dev.xml $1
mpmc=mvn package -Dmaven.test.skip=true --settings C:\Users\qhong\.m2\settings_dev.xml $1
mimc=mvn install -Dmaven.test.skip=true --settings C:\Users\qhong\.m2\settings_dev.xml $1
mcs=mvn compile -DskipTests $1
mps=mvn package -DskipTests $1
mis=mvn install -DskipTests $1
mcsc=mvn compile -DskipTests --settings C:\Users\qhong\.m2\settings_dev.xml $1
mpsc=mvn package -DskipTests --settings C:\Users\qhong\.m2\settings_dev.xml $1
misc=mvn install -DskipTests --settings C:\Users\qhong\.m2\settings_dev.xml $1
mccm=mvn clean compile -Dmaven.test.skip=true $1
mcpm=mvn clean package -Dmaven.test.skip=true $1
mcim=mvn clean install -Dmaven.test.skip=true $1
mccmc=mvn clean compile -Dmaven.test.skip=true --settings C:\Users\qhong\.m2\settings_dev.xml $1
mcpmc=mvn clean package -Dmaven.test.skip=true --settings C:\Users\qhong\.m2\settings_dev.xml $1
mcimc=mvn clean install -Dmaven.test.skip=true --settings C:\Users\qhong\.m2\settings_dev.xml $1
mccs=mvn clean compile -DskipTests $1
mcps=mvn clean package -DskipTests $1
mcis=mvn clean install -DskipTests $1
mccsc=mvn clean compile -DskipTests --settings C:\Users\qhong\.m2\settings_dev.xml $1
mcpsc=mvn clean package -DskipTests --settings C:\Users\qhong\.m2\settings_dev.xml $1
mcisc=mvn clean install -DskipTests --settings C:\Users\qhong\.m2\settings_dev.xml $1
mdt=mvn dependency:tree $1
mdtv=mvn dependency:tree -Dverbose $1
mdti=mvn dependency:tree -Dincludes=$1
mdte=mvn dependency:tree -Dexcludes=$1
mdtvi=mvn dependency:tree -Dverbose -Dincludes=$*
mdtve=mvn dependency:tree -Dverbose -Dexcludes=$1
mdd=mvn deploy -Dnexus=18.16.200.10:8081
mdp=mvn dependency:purge-local-repository $1
mdpi=mvn dependency:purge-local-repository -Dincludes=$1
mdpe=mvn dependency:purge-local-repository -Dexcludes=$1
mdpa=mvn dependency:purge-local-repository -DactTransitively=false $1
mdpai=mvn dependency:purge-local-repository -DactTransitively=false -Dincludes=$1
mdpae=mvn dependency:purge-local-repository -DactTransitively=false -Dexcludes=$1
mdpr=mvn dependency:purge-local-repository -DreResolve=false $1
mdpri=mvn dependency:purge-local-repository -DreResolve=false -Dincludes=$1
mdpre=mvn dependency:purge-local-repository -DreResolve=false -Dexcludes=$1
mdpar=mvn dependency:purge-local-repository -DactTransitively=false -DreResolve=false $1
mdparf=mvn dependency:purge-local-repository -DactTransitively=false -DreResolve=false --fail-at-end $1
mdpari=mvn dependency:purge-local-repository -DactTransitively=false -DreResolve=false -Dincludes=$1
mdpare=mvn dependency:purge-local-repository -DactTransitively=false -DreResolve=false -Dexcludes=$1
mdparm=mvn dependency:purge-local-repository -DactTransitively=false -DreResolve=false -DmanualIncludes=$1
mcpd=mvn clean package docker:build $1
mcpdp=mvn clean package docker:build -DpushImage $1
mcpdpm=mvn clean package docker:build -DpushImage -Dmaven.test.skip=true $1
mcpdpms=mvn clean package docker:build -DpushImage -Dmaven.test.skip=true --settings C:\Users\qhong\.m2\settings_dev.xml $1
nwr=netsh winsock reset $1
dsg=du -sh .git/ $1 $2 $3 $4 $5 $6 $7 $8 $9
dh=du -h --max-depth=1 $1 $2 $3 $4 $5 $6 $7 $8 $9
ga=git add $1 $2 $3 $4 $5 $6 $7 $8 $9
gaa=git add . $1 $2 $3 $4 $5 $6 $7 $8 $9
gb=git branch $1 $2 $3 $4 $5 $6 $7 $8 $9
gba=git branch -a $1 $2 $3 $4 $5 $6 $7 $8 $9
gbc=git branch --contains $1 $2 $3 $4 $5 $6 $7 $8 $9
gbr=git branch $1 $2 $3 $4 $5 $6 $7 $8 $9
gbuu=git branch --unset-upstream $1 $2 $3 $4 $5 $6 $7 $8 $9
gca=git commit - a $1 $2 $3 $4 $5 $6 $7 $8 $9
gcc=git commit -a -m $1 $2 $3 $4 $5 $6 $7 $8 $9
gci=git commit $1 $2 $3 $4 $5 $6 $7 $8 $9
gcl=git clone $1 $2 $3 $4 $5 $6 $7 $8 $9
gcm=git commit -m $1 $2 $3 $4 $5 $6 $7 $8 $9
gco=git checkout $1 $2 $3 $4 $5 $6 $7 $8 $9
gcoo=git checkout --orphan $1 $2 $3 $4 $5 $6 $7 $8 $9
gcov=git count-objects -v $1 $2 $3 $4 $5 $6 $7 $8 $9
gcp=git cherry-pick $1 $2 $3 $4 $5 $6 $7 $8 $9
gcv=git cherry -v $1 $2 $3 $4 $5 $6 $7 $8 $9
gcvm=git cherry -v master
gd=git diff $1 $2 $3 $4 $5 $6 $7 $8 $9
gdc=git diff --cached $1 $2 $3 $4 $5 $6 $7 $8 $9
gf=git fsck $1 $2 $3 $4 $5 $6 $7 $8 $9
gl=git l $1 $2 $3 $4 $5 $6 $7 $8 $9
gle=git l --grep=$1 $2 $3 $4 $5 $6 $7 $8 $9
glg=git lg $1 $2 $3 $4 $5 $6 $7 $8 $9
glgg=git lgg $1 $2 $3 $4 $5 $6 $7 $8 $9
glggn=git lgg --author=$1 $2 $3 $4 $5 $6 $7 $8 $9
glgn=git lg --author=$1 $2 $3 $4 $5 $6 $7 $8 $9
gln=git l --author=$1 $2 $3 $4 $5 $6 $7 $8 $9
gmn=git merge --no-ff $1 $2 $3 $4 $5 $6 $7 $8 $9
gms=git merge --squash $1 $2 $3 $4 $5 $6 $7 $8 $9
gmt=git mergetool $1 $2 $3 $4 $5 $6 $7 $8 $9
gnb=git checkout -b $1 $2 $3 $4 $5 $6 $7 $8 $9
gp=git pull $1 $2 $3 $4 $5 $6 $7 $8 $9
gpa=sh gpa.sh
gpl=git pull origin $1 $2 $3 $4 $5 $6 $7 $8 $9
gplm=git pull origin master $1 $2 $3 $4 $5 $6 $7 $8 $9
gpr=git prune $1 $2 $3 $4 $5 $6 $7 $8 $9
gps=git push origin $1 $2 $3 $4 $5 $6 $7 $8 $9
gpsm=git push origin master $1 $2 $3 $4 $5 $6 $7 $8 $9
gr=git rebase $1 $2 $3 $4 $5 $6 $7 $8 $9
grh=git reset --hard $1 $2 $3 $4 $5 $6 $7 $8 $9
gri=git rebase -i $1 $2 $3 $4 $5 $6 $7 $8 $9
grpo=git remote prune origin $1 $2 $3 $4 $5 $6 $7 $8 $9
grs=git reset $1 $2 $3 $4 $5 $6 $7 $8 $9
gs=git show $1 $2 $3 $4 $5 $6 $7 $8 $9
gst=git status -sb $1 $2 $3 $4 $5 $6 $7 $8 $9
gt=git tag $1 $2 $3 $4 $5 $6 $7 $8 $9
sco=scoop $1 $2 $3 $4 $5 $6 $7 $8 $9
sp=scoop $1 $2 $3 $4 $5 $6 $7 $8 $9
arc=aria2c $1 $2 $3 $4 $5 $6 $7 $8 $9
nreqs=echo reqs|nc $1 $2 $3 $4 $5 $6 $7 $8 $9
ncons=echo cons|nc $1 $2 $3 $4 $5 $6 $7 $8 $9
nstat=echo stat|nc $1 $2 $3 $4 $5 $6 $7 $8 $9
nenvi=echo envi|nc $1 $2 $3 $4 $5 $6 $7 $8 $9
sjmeter=start /b java -jar ApacheJMeter.jar
jarar=java -jar D:\Program Files\arthas\arthas-boot.jar
as=as.bat $1 $2 $3 $4 $5 $6 $7 $8 $9
traces=trace --skipJDKMethod false $1 $2 $3 $4 $5 $6 $7 $8 $9
tracesc=trace --skipJDKMethod false $1 $2 $3 $4 $5 $6 $7 $8 $9 '#cost > 10'
lx=lxrunoffline $1 $2 $3 $4 $5 $6 $7 $8 $9
cs-dstatus=cscript "C:\Program Files\Microsoft Office\Office16\ospp.vbs" /dstatus
cs-rearm=cscript "C:\Program Files\Microsoft Office\Office16\ospp.vbs" /rearm
cs-del=cscript "C:\Program Files\Microsoft Office\Office16\ospp.vbs" /unpkey:$1 $2 $3 $4
cs-act=cscript "C:\Program Files\Microsoft Office\Office16\ospp.vbs" /act
cs-add=cscript "C:\Program Files\Microsoft Office\Office16\ospp.vbs" /inpkey:$1 $2 $3 $4
还有部分cmder中文乱码的
Settings-->Startup-->Environent
设置
chcp 65001 utf-8
chcp 936 gbk