This is a custom configuration for Cmder. It mainly contains :
- some aliases
- a custom prompt inspired by
agnoster
themeadmin
symbol on black backgound (optionnal - not displayed by default)user@hostname
on black backgound (optionnal - not displayed by default)current directory path
on blue backgroundgit
folders on green background for clean repo and yellow for dirtynpm
module name and version (black background)
with Ubuntu theme |
Download the Meslo LG M font
You are able to use any font in Cmder
, but this font contains the symbols included in the prompt.
These dependencies are required only if you use a powershell
console
Install-Module oh-my-posh -Scope CurrentUser
Install-Module posh-git -AllowClobber -Scope CurrentUser
Install-Module Get-ChildItemColor -Scope CurrentUser
To show symbols correctly:
- Go to Cmder Settings => Main
- Choose Main console font to be what you prefer
- Choose Alternative font to be Meslo LG M For Powerline
- Modify the value of Unicode ranges to add:
E0A0; E0B0; 26A1
- Save Settings
Download all files, and place it (or create symbolic links) in %CMDER_ROOT%/config
folder.
Restart Cmder to load the custom configuration.
All These modifications required to open a new console in cmder
.
You can modify the prompt to display either the full path or only the folder name.
To do this, add an environment variable CMDER_CUSTOM_PROMPT_PATH_TYPE
in user-profile.cmd
The value could be either:
full
for full path likeC:\Windows\System32
(default value)folder
for folder name only likeSystem32
set CMDER_CUSTOM_PROMPT_PATH_TYPE=folder
You can substitute the user home path by a ~
character (only available with PROMPT_FULL
)
To do this, add an environment variable CMDER_CUSTOM_PROMPT_TILDE_SUBSTITUTION
in user-profile.cmd
(active by default)
set CMDER_CUSTOM_PROMPT_TILDE_SUBSTITUTION=false
You can modify the prompt to display a High voltage
symbol at the beginning of the prompt when the current user has admin rights.
To do this, add an environment variable CMDER_CUSTOM_PROMPT_DISPLAY_ADMIN
in user-profile.cmd
(inactive by default)
This feature is quite slow (approximately 0.2~0.3 second)
set CMDER_CUSTOM_PROMPT_DISPLAY_ADMIN=true
You can modify the prompt to display the current user
and hostname
.
To do this, add an environment variable CMDER_CUSTOM_PROMPT_DISPLAY_USER
in user-profile.cmd
(inactive by default)
set CMDER_CUSTOM_PROMPT_DISPLAY_USER=true
The script debug.lua
displays the time passed in each lua function called.
To active this script, add an environment variable CLINK_PROMPT_DEBUG
with value true
set CLINK_PROMPT_DEBUG=true
You can change the prompt theme.
To do this, modify the line Set-Theme <themeName>
with the desired theme in file my-user-profile.ps1
.
List of available themes on oh-my-posh
You can modify the prompt to display the current user
and hostname
.
To do this, comment the line $DefaultUser = $env:USERNAME
in file my-user-profile.ps1