Skip to content

Instantly share code, notes, and snippets.

@sclarson
Created July 21, 2016 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sclarson/e68eb83e91b18947a39aaffec26a7c7f to your computer and use it in GitHub Desktop.
Save sclarson/e68eb83e91b18947a39aaffec26a7c7f to your computer and use it in GitHub Desktop.
:: Init Script for cmd.exe
:: Sets some nice defaults
:: Created as part of cmder project
:: Find root dir
@if not defined CMDER_ROOT (
for /f %%i in ("%ConEmuDir%\..\..") do @set CMDER_ROOT=%%~fi
)
:: Change the prompt style
:: Mmm tasty lamb
@prompt $E[1;32;40m$P$S{git}$S$_$E[1;30;40m{lamb}$S$E[0m
:: Pick right version of clink
@if "%PROCESSOR_ARCHITECTURE%"=="x86" (
set architecture=86
) else (
set architecture=64
)
:: Run clink
@"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config"
:: Prepare for msysgit
:: I do not even know, copypasted from their .bat
@set PLINK_PROTOCOL=ssh
@if not defined TERM set TERM=cygwin
:: Enhance Path
rem @set git_install_root=%CMDER_ROOT%\vendor\msysgit
@set git_install_root=C:\Program Files\Git
@set PATH=%CMDER_ROOT%\bin;%git_install_root%\bin;%git_install_root%\mingw64\bin;%git_install_root%\cmd;%git_install_root%\usr\share\vim\vim74;%CMDER_ROOT%;%PATH%
:: Add aliases
@doskey /macrofile="%CMDER_ROOT%\config\aliases"
:: Set home path
@if not defined HOME set HOME=%USERPROFILE%
@if defined CMDER_START (
@cd /d "%CMDER_START%"
) else (
@if "%CD%\" == "%CMDER_ROOT%" (
@cd /d "%HOME%"
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment