From 4bfdf04d59dab80e1ce76d7125c546006273e188 Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Wed, 25 Nov 2015 00:11:34 +0100 Subject: [PATCH 1/2] Do not overwrite cmder.lua on update --- {config => vendor}/cmder.lua | 10 ++++++++++ vendor/init.bat | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) rename {config => vendor}/cmder.lua (92%) diff --git a/config/cmder.lua b/vendor/cmder.lua similarity index 92% rename from config/cmder.lua rename to vendor/cmder.lua index 836540d3b..deea404fb 100644 --- a/config/cmder.lua +++ b/vendor/cmder.lua @@ -189,3 +189,13 @@ for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do dofile(filename) end end + +-- now do the same for all lua files in config which do not start with '_' +local user_config_dir = clink.get_env('CMDER_ROOT')..'\\config\\' +for _,lua_module in ipairs(clink.find_files(user_config_dir..'*.lua')) do + -- Skip files that starts with _. This could be useful if some files should be ignored + if not string.match(lua_module, '^_.*') then + local filename = user_config_dir..lua_module + dofile(filename) + end +end diff --git a/vendor/init.bat b/vendor/init.bat index 6f1455102..36b0a50d5 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -24,7 +24,7 @@ ) :: Run clink -@"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" +@"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\vendor" :: Prepare for git-for-windows From 105e381e666cc9015c933b8039b5dcc95313db36 Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Wed, 25 Nov 2015 00:12:04 +0100 Subject: [PATCH 2/2] Document the files in config --- config/Readme.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/config/Readme.md b/config/Readme.md index 77e232678..de140d37b 100644 --- a/config/Readme.md +++ b/config/Readme.md @@ -1,3 +1,14 @@ ## Config -All config files must be in this folder. If there is no option to set this folder directly, it has to be hardlinked. \ No newline at end of file +All config files must be in this folder. If there is no option to set this folder +directly, it has to be hardlinked. + +* `aliases`: aliases in cmd; called form vendor\init.bat; autocreated from + `vendor\aliases.example`. +* `*.lua`: clink completitions and prompt filters; called from vendor\cmder.lua after all + other prompt filter and clink completitons are initialized; add your own. +* `user_profile.{sh|bat|ps1}: startup files for bash|cmd|powershell tasks; called from their + respective startup scripts in `vendor\`; autocreated on first start of such a task +* `.history`: the current commandline history; autoupdated on close +* `settings`: settings for readline; overwritten on update +* `ConEmu.xml`: settings from ConEmu (=the UI of cmder -> Preferences); overwritten on update \ No newline at end of file