Skip to content

Instantly share code, notes, and snippets.

@Jiahonzheng
Last active March 2, 2019 14:24
Show Gist options
  • Save Jiahonzheng/2814c1839b9ad5936b737ca7ef7b1485 to your computer and use it in GitHub Desktop.
Save Jiahonzheng/2814c1839b9ad5936b737ca7ef7b1485 to your computer and use it in GitHub Desktop.
PowerShell: oh-my-posh

How to beautify PowerShell

Steps

Here are steps to beautify PowerShell.

PowerShellGet

PowerShellGet is a PowerShell module with commands for discovering, installing, updating and publishing the PowerShell artifacts like Modules, DSC Resources, Role Capabilities and Scripts.

# Install
Install-Module -Name PowerShellGet -Force

posh-git

posh-git is a PowerShell module that integrates Git and PowerShell by providing Git status summary information.

PowerShellGet\Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force

oh-my-posh

# Install oh-my-posh
Install-Module oh-my-posh -Scope CurrentUser

# Set Theme
Set-Theme Paradox

$PROFILE

Update the content of $PROFILE to Microsoft.PowerShell_profile.ps1.

# Show the location of PowerShell Profile
$PROFILE

Sarasa Mono SC

Sarasa-Gothic is a Chinese & Japanese programming font based on Iosevka and Source Han Sans.

We should use Sarasa Mono SC fonts:

  • sarasa-mono-sc-bold.ttf
  • sarasa-mono-sc-bolditalic.ttf
  • sarasa-mono-sc-italic.ttf
  • sarasa-mono-sc-regular.ttf

concfg

concfg is a utility to import and export Windows console settings like fonts and colors.

# Install scoop
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

# Install concfg
scoop install concfg

# Import theme settings
concfg import .\Theme.cfg

Visual Studio Code

Update terminal.integrated.fontFamiliy in User Settings to Sarasa Mono SC.

{
  "terminal.integrated.fontFamily": "Sarasa Mono SC"
}
Import-Module oh-my-posh
Set-Theme Paradox
$DefaultUser = "Jiahonzheng"
{
"cursor_size": "small",
"command_history_length": 50,
"num_history_buffers": 4,
"command_history_no_duplication": false,
"quick_edit": true,
"insert_mode": true,
"load_console_IME": true,
"font_face": "Sarasa Mono SC",
"font_true_type": true,
"font_size": "0x16",
"font_weight": 0,
"screen_buffer_size": "80x3000",
"window_size": "120x50",
"fullscreen": false,
"popup_colors": "cyan,white",
"screen_colors": "white,black",
"black": "#1E1E1E",
"dark_blue": "#2472C8",
"dark_green": "#0DBC79",
"dark_cyan": "#11A8CD",
"dark_red": "#CD3131",
"dark_magenta": "#BC3FBC",
"dark_yellow": "#E5E510",
"gray": "#E5E5E5",
"dark_gray": "#666666",
"blue": "#3B8EEA",
"green": "#23D18B",
"cyan": "#29B8DB",
"red": "#F14C4C",
"magenta": "#D670D6",
"yellow": "#F5F543",
"white": "#E5E5E5"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment