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,对其最上栏进行右键
修改为旧版控制台即可!
更改提示符:
默认的为λ,改成常用的$
打开cmdervendor目录下面的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:Usersqhong.m2settings_dev.xml mcpmc = mvn clean package -Dmaven.test.skip=true --settings C:Usersqhong.m2settings_dev.xml mcimc = mvn clean install -Dmaven.test.skip=true --settings C:Usersqhong.m2settings_dev.xml mccs=mvn clean compile -DskipTests mcps=mvn clean package -DskipTests mcis=mvn clean install -DskipTests mccsc = mvn clean compile -DskipTests --settings C:Usersqhong.m2settings_dev.xml mcpsc = mvn clean package -DskipTests --settings C:Usersqhong.m2settings_dev.xml mcisc = mvn clean install -DskipTests --settings C:Usersqhong.m2settings_dev.xml sudo=ConEmuC -c $* -new_console:a vscode = "D:Program FilesMicrosoft VS CodeCode.exe" $1 idea = "D:Program Files (x86)JetBrainsIntelliJ IDEA 2018.1inidea64.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%system32doskey /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=cdclear=clshistory=cat"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 ∗−newconsole:avscode="D:ProgramFilesMicrosoftVSCodeCode.exe"1 --disable-gpu idea = "D:Program Files (x86)JetBrainsIntelliJ IDEAinidea64.exe" $1 --disable-gpu zkc=zkCli.cmd -server $1 chcp9=chcp 936 chcp6=chcp 65001 kpid=taskkill /pid 1/fkpname=taskkill/f/t/im1.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 1mpm=mvnpackage−Dmaven.test.skip=true1 mim=mvn install -Dmaven.test.skip=true 1mcmc=mvncompile−Dmaven.test.skip=true−−settingsC:Usersqhong.m2settingsdev.xml1 mpmc = mvn package -Dmaven.test.skip=true --settings C:Usersqhong.m2settings_dev.xml 1mimc=mvninstall−Dmaven.test.skip=true−−settingsC:Usersqhong.m2settingsdev.xml1 mcs=mvn compile -DskipTests 1mps=mvnpackage−DskipTests1 mis=mvn install -DskipTests 1mcsc=mvncompile−DskipTests−−settingsC:Usersqhong.m2settingsdev.xml1 mpsc = mvn package -DskipTests --settings C:Usersqhong.m2settings_dev.xml 1misc=mvninstall−DskipTests−−settingsC:Usersqhong.m2settingsdev.xml1 mccm=mvn clean compile -Dmaven.test.skip=true 1mcpm=mvncleanpackage−Dmaven.test.skip=true1 mcim=mvn clean install -Dmaven.test.skip=true 1mccmc=mvncleancompile−Dmaven.test.skip=true−−settingsC:Usersqhong.m2settingsdev.xml1 mcpmc = mvn clean package -Dmaven.test.skip=true --settings C:Usersqhong.m2settings_dev.xml 1mcimc=mvncleaninstall−Dmaven.test.skip=true−−settingsC:Usersqhong.m2settingsdev.xml1 mccs=mvn clean compile -DskipTests 1mcps=mvncleanpackage−DskipTests1 mcis=mvn clean install -DskipTests 1mccsc=mvncleancompile−DskipTests−−settingsC:Usersqhong.m2settingsdev.xml1 mcpsc = mvn clean package -DskipTests --settings C:Usersqhong.m2settings_dev.xml 1mcisc=mvncleaninstall−DskipTests−−settingsC:Usersqhong.m2settingsdev.xml1 mdt=mvn dependency:tree 1mdtv=mvndependency:tree−Dverbose1 mdti=mvn dependency:tree -Dincludes=1mdte=mvndependency:tree−Dexcludes=1 mdtvi=mvn dependency:tree -Dverbose -Dincludes=∗mdtve=mvndependency:tree−Dverbose−Dexcludes=1 mdp=mvn dependency:purge-local-repository 1mdpi=mvndependency:purge−local−repository−Dincludes=1 mdpe=mvn dependency:purge-local-repository -Dexcludes=1mdpa=mvndependency:purge−local−repository−DactTransitively=false1 mdpai=mvn dependency:purge-local-repository -DactTransitively=false -Dincludes=1mdpae=mvndependency:purge−local−repository−DactTransitively=false−Dexcludes=1 mdpr=mvn dependency:purge-local-repository -DreResolve=false 1mdpri=mvndependency:purge−local−repository−DreResolve=false−Dincludes=1 mdpre=mvn dependency:purge-local-repository -DreResolve=false -Dexcludes=1mdpar=mvndependency:purge−local−repository−DactTransitively=false−DreResolve=false1 mdparf=mvn dependency:purge-local-repository -DactTransitively=false -DreResolve=false --fail-at-end 1mdpari=mvndependency: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 1mcpdp=mvncleanpackagedocker:build−DpushImage1 mcpdpm=mvn clean package docker:build -DpushImage -Dmaven.test.skip=true 1mcpdpms=mvncleanpackagedocker:build−DpushImage−Dmaven.test.skip=true−−settingsC:Usersqhong.m2settingsdev.xml1 nwr=netsh winsock reset $1 dsg = du -sh .git/ 12 34 56 78 $9 ga = git add 12 34 56 78 9gb=gitbranch1 23 45 67 89 gd = git diff 12 34 56 78 9gr=gitrebase1 23 45 67 89 gp = git pull 12 34 56 78 9gf=gitfsck1 23 45 67 89 gt = git tag 12 34 56 78 9gs=gitshow1 23 45 67 89 gpr = git prune 12 34 56 78 9gpl=gitpullorigin1 23 45 67 89 gps = git push origin 12 34 56 78 9gaa=gitadd.1 23 45 67 89 gbr = git branch 12 34 56 78 9gba=gitbranch−a1 23 45 67 89 gbc = git branch --contains 12 34 56 78 9gca=gitcommit−a1 23 45 67 89 gcl = git clone 12 34 56 78 9gci=gitcommit1 23 45 67 89 gcc = git commit -a -m 12 34 56 78 9gcm=gitcommit−m1 23 45 67 89 gco = git checkout 12 34 56 78 9gcp=gitcherry−pick1 23 45 67 89 gdc = git diff --cached 12 34 56 78 9grs=gitreset1 23 45 67 89 grh = git reset --hard 12 34 56 78 9gri=gitrebase−i1 23 45 67 89 gnb = git checkout -b 12 34 56 78 9gst=gitstatus−sb1 23 45 67 89 gmn = git merge --no-ff 12 34 56 78 9gms=gitmerge−−squash1 23 45 67 89 gplm = git pull origin master 12 34 56 78 9gpsm=gitpushoriginmaster1 23 45 67 89 grpo = git remote prune origin 12 34 56 78 9gbuu=gitbranch−−unset−upstream1 23 45 67 89 gl = git l 12 34 56 78 9glg=gitlg1 23 45 67 89 glgg = git lgg 12 34 56 78 9gln=gitl−−author=1 23 45 67 89 glgn = git lg --author=12 34 56 78 9glggn=gitlgg−−author=1 23 45 67 89 gle =git l --grep=12 34 56 78 9gmt=gitmergetool1 23 45 67 89 gpaa = git branch | awk 'BEGIN{print "echo ****Update all local branch****"}{if(1=="∗")current=substr($0,3);printa"gitcheckout"substr(0,3);print "git pull --all";}END{print "git checkout " current}' |sh gpa = sh gpa.sh jarar = java -jar arthas-boot.jar sco = scoop 12 34 56 78 9sp=scoop1 23 45 67 89 gcov = git count-objects -v 12 34 56 78 9arc=aria2c1 23 45 67 89 nreqs = echo reqs|nc 12 34 56 78 9ncons=echocons|nc1 23 45 67 89 nstat = echo stat|nc 12 34 56 78 9nenvi=echoenvi|nc1 23 45 67 89
chcp9=chcp 936 chcp6=chcp 65001
chcp 936 简体中文
chcp 65001 utf-8
https://github.com/cmderdev/cmder
http://www.cnblogs.com/xishuai/p/cmder-git-bash.html
https://segmentfault.com/a/1190000004408436
http://xiaogliu.github.io/2017/04/07/install-and-configure-cmder/
https://segmentfault.com/a/1190000010304395
http://www.php-master.com/post/305188.html
https://blog.csdn.net/lamp_yang_3533/article/details/79841328