Guide + Config files for setting up pwsh.
Powershell setup with modules like oh-my-posh, scoop, z, posh-git, fzf (fuzzy-finder), terminal icons
Neovim setup with modules like packer, tree-sitter, lsp
Windows has a powershell which is built on .NET Framework which is only compatible on windows and doesnt have many features. So first install a modern powershell from Microsoft Store.
Get this one.
Open powershell and click on the arrow button on the taskbar > Click on Settings
Change the options to this
Go to Defaults > Appearance and Enable acrylic material, And bring down the opacity for transparent powershell background. (Now you are one of the modern genz cool people)
In order for extra features with fonts, Install a patched font from Nerdfont.
Then again go and change the font in Defaults > Appearance > Fonts to Your patched font. (My choice was Hack). Read the docs to install the nerdfont on windows, (Simply you download a zip for a font, extract it, click on the .otf or .ttf file and press on Install to install it to your system).
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex
Now scoop has been installed
Install all modules from your terminal now!
scoop install neovim
You can install other useful modules like curl, sudo, fzf using same logic.
Warning
Install-Module -Name oh-my-posh -Scope CurrentUser -Force
Has been deprecated
Use scoop to install oh-my-posh (You can use winget also. Your freedom of choice)
scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json
oh-my-posh has been installed!
Similarly download posh-git using this command:
PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force
you can find out where your themes are stored by doing
echo "$env:POSH_THEMES_PATH"
Lets make a config file that we will pass to the powershell profile so that it can load this config file before loading.
mkdir .config/powershell
nvim .config/powershell/user_profile.ps1
Note .ps1 is used to write powershell commands.
Note I have chosen amro.omp.json but you can choose any theme given in here
While you are at it, you can also make aliases for a bunch of command, that will make it easy for you to use
And utility functions for similar reasons
Adding this config file to the powershell profile
Execute following command to show where the profile of powershell is stored
echo "$PROFILE"
Open profile in nvim by using the following command
nvim $PROFILE
And add the following Lines.
Now when you restart your shell, your config file will be loaded.
Execute this in powershell
Install-Module -Name Terminal-Icons -Repository PSGallery
And add this line to config file to enable Terminal Icons
Result of Terminal Icons.
Check fzf Github Repo to see whats happening, we will use PZfzf Wrapper to extend the extensibility of it to output auto paths and commands on pwsh
Install fzf
scoop install fzf
Install PZfzf
Install-Module -Name PSFzf -Scope CurrentUser -Force
Now go to your powershell config in ~/.config/powershell/user_profile.ps1 that you set up and add the following commands