惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
爱范儿
爱范儿
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
博客园_首页
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
V
V2EX
V
Visual Studio Blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image 腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名) Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH Nifty LaTeX Techniques -- Series 1 更改 Adsense 邮寄地址,重新寄送 PIN
Cmder Advanced Configurations
2019-02-03 · via jdhao's digital space

In this post, I summarize some of the advanced configurations of Cmder.

How to set up the default startup directory for a task?#

Open Cmder settings and go to Startup --> Tasks and choose a task (cmd::Cmder or Cmd::Cmder as Admin, etc.). Click Startup dir... on the bottom right of the page and choose the appropriate directory. Restart Cmder and you should be able to see that Cmder start up in the given directory.

But, if you have set up startup directory this, cmder here feature will not any more: Cmder will always open the directory you have set up.

Add custom color scheme to Cmder#

There is a project ConEmu-Color-Themes which provides a few color schemes for ConEmu, on which Cmder is based.

First, we need to clone this project to our local machine:

git clone https://github.com/joonro/ConEmu-Color-Themes
cd ConEmu-Color-Themes

This project provides a powershell script Install-ConEmuTheme.ps1 to simplify the installation of color themes. To run this script, we need to give it execution permission:

  • Open powershell and run it as administrator
  • Run the following command inside powershell:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force

Next, in order to avoid any errors, export your current Cmder settings to a custom directory.

Then, run the following command in Cmder:

powershell ./Install-ConEmuTheme.ps1 -ConfigPath /path/to/exported/setting/ConEmu.xml -Operation Add -ThemePathOrName themes\moe-dark.xml

It will add the theme moe-dark to the theme list. Be careful with the space in path. If a path has space in it, you will encounter ParameterArgumentValidationError exception. The solution is to enclose the path with single quote.

Finally, open Cmder setting and import the new setting file from the custom directory. You should be able to see the new color schemes.

Creating an alias in Cmder#

Sometimes, we need to type a command over and over again. It is better to create a shorter alias for it. A great example is changing to directories on other drives on Windows. Due to histortical reasons, the cd command can only go to directories on the current drive by default. To go to directories on other drives, we need the /d parameters. Having to use cd /d each time is cumbersome.

If you expect cd to go to another directory no matter whether it is on the current drive or another drive, you can create an alias for it. Here is how to do it in Cmder:

  • Go to $CMDER_ROOT/config and open the file user_aliaes.cmd
  • Add the following to the end of the file:

Another way is to open cmder settings (Win+ Alt + P), go to Startup --> Environment, and add the following alias for cd:

Restart Cmder and you should be able to cd to any directory you want! It is a small trick, but it works great and saves your time.

References#