Skip to content

Instantly share code, notes, and snippets.

@dizys
Last active September 23, 2021 23:37
Show Gist options
  • Save dizys/d6ab3dee506930da724b075864af8eb7 to your computer and use it in GitHub Desktop.
Save dizys/d6ab3dee506930da724b075864af8eb7 to your computer and use it in GitHub Desktop.
My PowerShell setup guide: Oh-My-Posh + render symbols properly + fix Ctrl+Backspace issue for Visual Studio Code.

My PowerShell Setup Guide

1. Find your PowerShell profile location

This shows your PowerShell profile location:

$Profile

It's usually somewhere like this: C:\Users\My Username\Documents\WindowsPowerShell.

2. Install Oh-My-Posh

Oh-My-Posh Docs: https://ohmyposh.dev/docs/pwsh

You probably have to use Nerd fonts in order for symbols to render properly.

Nerd fonts: https://www.nerdfonts.com/font-downloads

3. Fix Ctrl+Backspace issue in VSCode

By default, Ctrl+Backspace in integrated terminal of VSCode to delete last typed word does not work for Powershell. This is probably a bug. Currently, a fix is to add the following code to your PowerShell profile:

if ($env:TERM_PROGRAM -eq "vscode") {
    Set-PSReadLineKeyHandler -Chord 'Ctrl+w' -Function BackwardKillWord
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment