Hansi 2 months ago
parent
commit
fb4ce5250f

+ 2 - 6
MyCmderSettings/download_config.bat

@@ -4,13 +4,9 @@ cd MyCmderSettings
 
 copy less.exe "%CMDER_ROOT%\vendor\git-for-windows\usr\bin"
 
-copy user-aliases.cmd "%CMDER_ROOT%\config"
+copy user_aliases.cmd "%CMDER_ROOT%\config"
 
-copy user-profile.cmd "%CMDER_ROOT%\config"
+copy user_profile.cmd "%CMDER_ROOT%\config"
 
 cd ..
 
-rm -rf MyCmderSettings
-
-
-

+ 0 - 16
MyCmderSettings/user-profile.cmd

@@ -1,16 +0,0 @@
-:: use this file to run your own startup commands
-:: use  in front of the command to prevent printing the command
-
-:: uncomment this to have the ssh agent load when cmder starts
-:: call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd"
-
-:: uncomment this next two lines to use pageant as the ssh authentication agent
-:: SET SSH_AUTH_SOCK=/tmp/.ssh-pageant-auth-sock
-:: call "%GIT_INSTALL_ROOT%/cmd/start-ssh-pageant.cmd"
-
-:: you can add your plugins to the cmder path like so
-set "PATH=%CMDER_ROOT%\vendor\git-for-windows\mingw64\bin;%PATH%"
-
-set LANG=zh_CN.UTF-8
-chcp 65001
-::chcp 65001

+ 9 - 1
MyCmderSettings/user-aliases.cmd → MyCmderSettings/user_aliases.cmd

@@ -5,6 +5,15 @@
 ;= goto:eof
 ;= Add aliases below here
 e.=explorer .
+gl=git log --oneline --all --graph --decorate  $*
+l=ls --show-control-chars -CFGNhp --color --ignore={"NTUSER.DAT*","ntuser.dat*"} $*
+ls=ls --show-control-chars -F --color $*
+pwd=cd
+clear=cls
+unalias=alias /d $1
+vi=vim $*
+cmderr=cd /d "%CMDER_ROOT%"
+pwsh=%SystemRoot%/System32/WindowsPowerShell/v1.0/powershell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%CMDER_ROOT%/vendor/profile.ps1'''"
 
 gl=git log --oneline --all --graph --decorate  $*
 gs=git status
@@ -27,7 +36,6 @@ config.=cd /d "%CMDER_ROOT%\config"
 
 pwd=cd
 clear=cls
-history=cat "%CMDER_ROOT%\config\.history"
 unalias=alias /d $1
 vi=vim $*
 

+ 19 - 0
MyCmderSettings/user_profile.cmd

@@ -0,0 +1,19 @@
+:: use this file to run your own startup commands
+:: use in front of the command to prevent printing the command
+
+:: uncomment this to have the ssh agent load when cmder starts
+:: call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd" /k exit
+
+:: uncomment the next two lines to use pageant as the ssh authentication agent
+:: SET SSH_AUTH_SOCK=/tmp/.ssh-pageant-auth-sock
+:: call "%GIT_INSTALL_ROOT%/cmd/start-ssh-pageant.cmd"
+
+:: you can add your plugins to the cmder path like so
+:: set "PATH=%CMDER_ROOT%\vendor\whatever;%PATH%"
+
+:: arguments in this batch are passed from init.bat, you can quickly parse them like so:
+:: more usage can be seen by typing "cexec /?"
+
+:: %ccall% "/customOption" "command/program"
+
+@echo off