mirror of
https://github.com/cmderdev/cmder.git
synced 2025-07-17 04:59:09 +08:00
Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
ee50cc5e7c | |||
f7d1dfa2b7 | |||
12d21de1c3 | |||
a231fd9f60 | |||
9d5d3e1556 | |||
d95f25207d | |||
f3d93c0f99 | |||
47b725bf0f | |||
6ae803987b | |||
027be08286 | |||
42bad3e509 | |||
2ac148ce22 | |||
55aef09412 | |||
0bde8b361a | |||
f9c6d61ee0 | |||
bbcbd2ece9 | |||
6f6d9f29ec | |||
4d926e0836 | |||
75cb46392e | |||
471e341a97 | |||
c2b37021d4 | |||
3fefa9698e | |||
14799b307d | |||
4c4930704f | |||
42d22f1e17 | |||
2d0a7093d4 | |||
f8b96665a8 | |||
049e54dfe0 | |||
dc0cc7350b | |||
8489977575 | |||
ee898d9d28 |
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,3 +5,5 @@ vendor/*
|
||||
!vendor/*.md
|
||||
!vendor/*.bat
|
||||
config/.history
|
||||
Thumbs.db
|
||||
*.exe
|
||||
|
@ -1,2 +1,3 @@
|
||||
@echo off
|
||||
start vendor/conemu-maximus5/ConEmu.exe /Title Cmder /LoadCfgFile ../../config/ConEmu.xml
|
||||
SET CMDER_ROOT=%~dp0
|
||||
start %~dp0/vendor/conemu-maximus5/ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%CMDER_ROOT%\config\ConEmu.xml"
|
||||
|
@ -8,7 +8,7 @@ Cmder is a **software package** created out of pure frustration over absence of
|
||||
|
||||
## Why use it
|
||||
|
||||
The main advantage of Cmder is portability. It is designed to be totally self-container. With no external dependencies. That makes is great for **USB Sticks** or **Dropbox**. So you can carry your console, aliases and binaries (like wget, curl and git) with you anywhere.
|
||||
The main advantage of Cmder is portability. It is designed to be totally self-contained with no external dependencies. That makes is great for **USB Sticks** or **Dropbox**. So you can carry your console, aliases and binaries (like wget, curl and git) with you anywhere.
|
||||
|
||||
## Installation
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
## Bin
|
||||
|
||||
Thif folder will be injected into path at runtime
|
||||
This folder will be injected into path at runtime
|
||||
|
@ -1,4 +1,28 @@
|
||||
@echo off
|
||||
if ["%1"] == ["/?"] goto:p_help
|
||||
if ["%2"] == [""] echo Insufficient parameters. & goto:p_help
|
||||
::validate alias
|
||||
setlocal
|
||||
for /f "delims== tokens=1" %%G in ("%*") do set _temp2=%%G
|
||||
|
||||
set _temp=%_temp2: =%
|
||||
|
||||
if not ["%_temp%"] == ["%_temp2%"] (
|
||||
echo Your alias name can not contain a space
|
||||
endlocal
|
||||
goto:eof
|
||||
)
|
||||
|
||||
echo %* >> %~dp0..\config\aliases
|
||||
doskey /macrofile=%~dp0..\config\aliases
|
||||
echo Alias created
|
||||
endlocal
|
||||
goto:eof
|
||||
|
||||
:p_help
|
||||
echo.Usage:
|
||||
echo. alias name=full command
|
||||
echo. $* allows the alias to assume all the parameters of the supplied command.
|
||||
echo. $1-$9 Allows you to seperate parameter by number, much like %%1 in batch.
|
||||
echo. $T is the command seperator, allowing you to string several commands together into one alias.
|
||||
echo. For more information, read DOSKEY/?
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<key name="Software">
|
||||
<key name="ConEmu">
|
||||
<key name=".Vanilla" modified="2013-09-07 17:36:51">
|
||||
<key name=".Vanilla" modified="2013-11-29 16:19:40" build="131107">
|
||||
<value name="ColorTable00" type="dword" data="00222827"/>
|
||||
<value name="ColorTable01" type="dword" data="009e5401"/>
|
||||
<value name="ColorTable02" type="dword" data="0004aa74"/>
|
||||
@ -127,8 +127,8 @@
|
||||
<value name="ConWnd Width" type="dword" data="0000006f"/>
|
||||
<value name="ConWnd Height" type="dword" data="0000001a"/>
|
||||
<value name="Cascaded" type="hex" data="01"/>
|
||||
<value name="ConWnd X" type="dword" data="0000008e"/>
|
||||
<value name="ConWnd Y" type="dword" data="00000037"/>
|
||||
<value name="ConWnd X" type="dword" data="000000bc"/>
|
||||
<value name="ConWnd Y" type="dword" data="00000065"/>
|
||||
<value name="16bit Height" type="dword" data="00000000"/>
|
||||
<value name="AutoSaveSizePos" type="hex" data="00"/>
|
||||
<value name="IntegralSize" type="hex" data="00"/>
|
||||
@ -411,9 +411,9 @@
|
||||
<value name="Key.JumpNextMonitor" type="dword" data="80808000"/>
|
||||
<value name="Key.TileToLeft" type="dword" data="80808000"/>
|
||||
<value name="Key.TileToRIght" type="dword" data="80808000"/>
|
||||
<value name="KeyMacro01" type="dword" data="00121131"/>
|
||||
<value name="KeyMacro01" type="dword" data="0012a031"/>
|
||||
<value name="KeyMacro01.Text" type="string" data="Task("cmd")"/>
|
||||
<value name="KeyMacro02" type="dword" data="00121132"/>
|
||||
<value name="KeyMacro02" type="dword" data="0012a032"/>
|
||||
<value name="KeyMacro02.Text" type="string" data="Task("PowerShell")"/>
|
||||
<value name="KeyMacro03" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro03.Text" type="string" data=""/>
|
||||
@ -483,28 +483,30 @@
|
||||
<value name="DndLKey" type="hex" data="00"/>
|
||||
<value name="DndRKey" type="hex" data="a2"/>
|
||||
<value name="WndDragKey" type="dword" data="00121101"/>
|
||||
<key name="Tasks" modified="2013-09-07 17:36:51">
|
||||
<key name="Tasks" modified="2013-11-29 16:19:41" build="131107">
|
||||
<value name="Count" type="dword" data="00000002"/>
|
||||
<key name="Task1" modified="2013-09-07 17:36:51">
|
||||
<key name="Task1" modified="2013-11-29 16:19:41" build="131107">
|
||||
<value name="Name" type="string" data="{cmd}"/>
|
||||
<value name="GuiArgs" type="string" data=" /icon "cmd.exe""/>
|
||||
<value name="Cmd1" type="string" data="cmd /k vendor\init.bat"/>
|
||||
<value name="Cmd1" type="string" data="cmd /k %CMDER_ROOT%\vendor\init.bat -new_console:d:%USERPROFILE%"/>
|
||||
<value name="Active" type="dword" data="00000000"/>
|
||||
<value name="Count" type="dword" data="00000001"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
</key>
|
||||
<key name="Task2" modified="2013-09-07 17:36:51">
|
||||
<key name="Task2" modified="2013-11-29 16:19:41" build="131107">
|
||||
<value name="Name" type="string" data="{PowerShell}"/>
|
||||
<value name="GuiArgs" type="string" data="/dir "%userprofile%""/>
|
||||
<value name="Cmd1" type="string" data="powershell"/>
|
||||
<value name="Active" type="dword" data="00000000"/>
|
||||
<value name="Count" type="dword" data="00000001"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
</key>
|
||||
</key>
|
||||
<key name="Apps" modified="2013-09-07 17:36:51">
|
||||
<key name="Apps" modified="2013-11-29 16:19:41" build="131107">
|
||||
<value name="Count" type="dword" data="00000000"/>
|
||||
</key>
|
||||
<key name="Colors" modified="2013-09-07 17:36:51">
|
||||
<key name="Palette1" modified="2013-09-07 17:36:51">
|
||||
<key name="Colors" modified="2013-11-29 16:19:41" build="131107">
|
||||
<key name="Palette1" modified="2013-11-29 16:19:41" build="131107">
|
||||
<value name="Name" type="string" data="Monokai"/>
|
||||
<value name="ExtendColors" type="hex" data="00"/>
|
||||
<value name="ExtendColorIdx" type="hex" data="0e"/>
|
||||
@ -550,6 +552,27 @@
|
||||
<value name="OneTabPerGroup" type="hex" data="00"/>
|
||||
<value name="ActivateSplitMouseOver" type="hex" data="01"/>
|
||||
<value name="TabBtnDblClick" type="dword" data="00000000"/>
|
||||
<value name="ConsoleExceptionHandler" type="hex" data="00"/>
|
||||
<value name="SaveCmdHistory" type="hex" data="00"/>
|
||||
<value name="CTS.IBeam" type="hex" data="01"/>
|
||||
<value name="Multi.SplitSizeVU" type="dword" data="00105d26"/>
|
||||
<value name="Multi.SplitSizeVD" type="dword" data="00105d28"/>
|
||||
<value name="Multi.SplitSizeHL" type="dword" data="00105d25"/>
|
||||
<value name="Multi.SplitSizeHR" type="dword" data="00105d27"/>
|
||||
<value name="Multi.SplitFocusU" type="dword" data="00005d26"/>
|
||||
<value name="Multi.SplitFocusD" type="dword" data="00005d28"/>
|
||||
<value name="Multi.SplitFocusL" type="dword" data="00005d25"/>
|
||||
<value name="Multi.SplitFocusR" type="dword" data="00005d27"/>
|
||||
<value name="CloseGroupPrcKey" type="dword" data="00000000"/>
|
||||
<value name="SetDefaultTerminalStartupTSA" type="hex" data="01"/>
|
||||
<value name="CTS.HtmlFormat" type="hex" data="00"/>
|
||||
<value name="TabIcons" type="hex" data="01"/>
|
||||
<value name="Multi.NewConsolePopup2" type="dword" data="00000000"/>
|
||||
<value name="CloseAllConKey" type="dword" data="00000000"/>
|
||||
<value name="CloseExceptConKey" type="dword" data="00000000"/>
|
||||
<value name="CTS.VkCopyFmt0" type="dword" data="00001143"/>
|
||||
<value name="CTS.VkCopyFmt1" type="dword" data="00101143"/>
|
||||
<value name="CTS.VkCopyFmt2" type="dword" data="00000000"/>
|
||||
</key>
|
||||
</key>
|
||||
</key>
|
||||
|
@ -1,4 +1,4 @@
|
||||
e.=explorer .
|
||||
gl=git log --oneline --all --graph --decorate $*
|
||||
ls=ls --color $*
|
||||
|
||||
pwd=cd
|
50
config/git.lua
Normal file
50
config/git.lua
Normal file
@ -0,0 +1,50 @@
|
||||
---
|
||||
-- Find out current branch
|
||||
-- @return {false|git branch name}
|
||||
---
|
||||
function get_git_branch()
|
||||
for line in io.popen("git branch 2>nul"):lines() do
|
||||
local m = line:match("%* (.+)$")
|
||||
if m then
|
||||
return m
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
---
|
||||
-- Get the status of working dir
|
||||
-- @return {bool}
|
||||
---
|
||||
function get_git_status()
|
||||
return os.execute("git diff-files --quiet --ignore-submodules")
|
||||
end
|
||||
|
||||
function git_prompt_filter()
|
||||
|
||||
-- Colors for git status
|
||||
local colors = {
|
||||
clean = "\x1b[1;37;40m",
|
||||
dirty = "\x1b[31;1m",
|
||||
}
|
||||
|
||||
local branch = get_git_branch()
|
||||
if branch then
|
||||
-- Has branch => therefore it is a git folder, now figure out status
|
||||
if get_git_status() then
|
||||
color = colors.clean
|
||||
else
|
||||
color = colors.dirty
|
||||
end
|
||||
|
||||
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", color.."("..branch..")")
|
||||
return true
|
||||
end
|
||||
|
||||
-- No git present or not in git file
|
||||
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", "")
|
||||
return false
|
||||
end
|
||||
|
||||
clink.prompt.register_filter(git_prompt_filter, 50)
|
BIN
icons/cmder.ico
Normal file
BIN
icons/cmder.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
BIN
icons/cmder_icon.psd
Normal file
BIN
icons/cmder_icon.psd
Normal file
Binary file not shown.
BIN
icons/icon_16.png
Normal file
BIN
icons/icon_16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
icons/icon_256.png
Normal file
BIN
icons/icon_256.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
BIN
icons/icon_32.png
Normal file
BIN
icons/icon_32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
icons/icon_48.png
Normal file
BIN
icons/icon_48.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
2
vendor/Readme.md
vendored
2
vendor/Readme.md
vendored
@ -1,3 +1,3 @@
|
||||
## Vendor
|
||||
|
||||
Softwere from third parties + init sctipt
|
||||
Software from third parties + init sctipt
|
||||
|
24
vendor/init.bat
vendored
24
vendor/init.bat
vendored
@ -3,13 +3,13 @@
|
||||
:: Created as part of cmder project
|
||||
|
||||
|
||||
:: Seting prompt style
|
||||
:: Setting prompt style
|
||||
@for /f "tokens=2 delims=:." %%x in ('chcp') do @set cp=%%x
|
||||
:: The slow part
|
||||
:: World without Unicode is a sad world
|
||||
@chcp 65001>nul
|
||||
:: It has to be lambda, I already made a logo
|
||||
@prompt $E[1;32;40m$P $_$E[1;30;40mλ $E[0m
|
||||
@prompt $E[1;32;40m$P$S{git}$S$_$E[1;30;40mλ$S$E[0m
|
||||
@chcp %cp%>nul
|
||||
|
||||
|
||||
@ -20,26 +20,24 @@
|
||||
set architecture=64
|
||||
)
|
||||
|
||||
@set rootDir="%~dp0\.."
|
||||
|
||||
:: Run clink
|
||||
@vendor\clink\clink_x%architecture%.exe inject --quiet --profile config
|
||||
@%rootDir%\vendor\clink\clink_x%architecture%.exe inject --quiet --profile %rootDir%\config
|
||||
|
||||
:: Prepare for msysgit
|
||||
|
||||
:: I do not even know, copypasted from their .bat
|
||||
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
|
||||
@if not exist "%HOME%" @set HOME=%USERPROFILE%
|
||||
@set PLINK_PROTOCOL=ssh
|
||||
@if not defined TERM set TERM=msys
|
||||
|
||||
:: Enhance Path
|
||||
@set rootDir=%CD%
|
||||
@set git_install_root=%CD%\vendor\msysgit
|
||||
@set PATH=%PATH%;%rootDir%\bin;%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;
|
||||
@set git_install_root=%rootDir%\vendor\msysgit
|
||||
@set PATH=%PATH%;%rootDir%\bin;%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%git_install_root%\share\vim\vim73;
|
||||
|
||||
:: Add aliases
|
||||
@doskey /macrofile=%rootDir%\config\aliases
|
||||
@doskey /macrofile="%rootDir%\config\aliases"
|
||||
|
||||
:: cd into users homedir
|
||||
@cd /d "%userprofile%"
|
||||
|
||||
@echo Welcome to cmder!
|
||||
:: Set home path
|
||||
@set HOME=%USERPROFILE%
|
||||
@echo Welcome to cmder!
|
||||
|
Reference in New Issue
Block a user