Recently, I migrated my development environment to Windows, and the long-lost Windows still brought me a lot of surprises. After some simple tinkering1, the experience of using the terminal is now very close to that of Mac.
This article is a sister article to a previous article I wrote - Terminal Tinkering Notes for Mac. The implementation ideas are mostly similar.
Preparation#
Configuration#
Terminal Configuration#
profiles.json structure#
Copy the color theme from iTerm and import it into the schemes
array. Then, in the list
, use this key-value pair "colorScheme":"lovelace"
to apply the theme color. Of course, you can also write it to defaults
, which will override all terminal configurations in list
.
PowerShell Configuration#
- Install oh-my-posh
# Installation command
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
- Download Powerline font
- Configure powershell_profile.ps1
# If there is no configuration file before, create a new PowerShell configuration file
if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
# Open the configuration file
vi $PROFILE
# Add content
Import-Module posh-git
Import-Module oh-my-posh
# Set the theme
Set-Theme Paradox
- Use vim in PowerShell
# Use the built-in vim in git
VS Code Configuration#
If you used a monospaced font in VS Code before, you will find that the command prompt appears garbled when you open the terminal. At this time, you need to set the font of the terminal to powerline, like this:
"terminal.integrated.fontFamily": "Meslo LG M (the font you are using) for Powerline"
Backup#
Now, let's summarize which files have been modified during the transformation of the terminal:
- profiles.json
- powershell_profile.ps1
- setting.json
By backing up these three files, you can restore a terminal with beautiful colors and powerful features on any Windows device.
Finally#
Actually, at this point, it can only be said that the basic transformation of the terminal in Windows has been achieved. There are still many parts that have not been tinkered with, such as:
- Keybindings
- WSL-related
- Writing your own themes
- Tricks and tips
For more details and usage tips, you can find them in the official documentation.
Footnotes#
-
The system environment must be Windows 10 (build
1903
) or above. ↩