End Goal
To build a terminal environment with:
- MSYS2
- Windows Terminal
- Winget
- Zsh
- Oh My Zsh
- Zsh Theme Of Choice: PowerLevel10k
Instructions
Install Windows Terminal and MSYS2 using CMD or PowerShell:
winget install Microsoft.WindowsTerminal ;
winget install MSYS2.MSYS2 ;
Open MSYS2 from windows search bar and start installing from there:
# Install git and ZSH
pacman -S git zsh ;
# Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" ;
# Generate ~/.zshrc
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc ;
Create MSYS2 Profile for Windows Terminal (use zsh):
- Open the Windows Terminal App
- Open the Settings Pane (CTRL + .)
- Click on Open JSON
- Add this item to profiles.list and change profiles.default to the same guid (
{71160544-14d8-4194-af25-d05feeac7233}
)
{
"commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -msys -use-full-path -shell zsh",
"elevate": true,
"guid": "{71160544-14d8-4194-af25-d05feeac7233}",
"icon": "C:/msys64/msys2.ico",
"name": "MSYS / MSYS2",
"startingDirectory": "C:/msys64/home/%USERNAME%"
}
Restart Windows Terminal and you should be able to see Zsh running.
Install ZSH Plugins
# Install Theme: Powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# Syntax Highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# Autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
In your ~/.zshrc, look for a line that says ZSH_THEME and change it to
ZSH_THEME="powerlevel10k/powerlevel10k"
In the same file, also modify the list of plugins: (ignore ssh-agent and gpg-agent if you haven't set up git)
plugins=(
git
ssh-agent
gpg-agent
zsh-syntax-highlighting
zsh-autosuggestions
)
Restart Windows Terminal for the final time and you should be brought to a powerlevel10k's wizard :)
References
EDIT: added suggestions from James 'Dante' Midzi's comments
Top comments (2)
It would be cool if you mentioned where the first installation needs to be (command prompt, poweshell etx) and what administrator rights are required
thanks for the feedback!