Skip to content

Easy-understanding Guide + Config files for setting up pwsh.

Notifications You must be signed in to change notification settings

kiranraaj19/pwsh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

pwsh

Guide + Config files for setting up pwsh.

Results

image

Powershell setup with modules like oh-my-posh, scoop, z, posh-git, fzf (fuzzy-finder), terminal icons

image

Neovim setup with modules like packer, tree-sitter, lsp

Lets Get Started With PWSH

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.

image

Get this one.

Open powershell and click on the arrow button on the taskbar > Click on Settings

image

Change the options to this

image

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).

Installing scoop

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex

Now scoop has been installed

Install all modules from your terminal now!

Installing neovim

scoop install neovim

You can install other useful modules like curl, sudo, fzf using same logic.

Setting up oh-my-posh and posh-git

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

Changing theme of your powershell

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.

image

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 image

And utility functions for similar reasons image

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.

image

Now when you restart your shell, your config file will be loaded.

Installing Terminal Icons

Execute this in powershell

Install-Module -Name Terminal-Icons -Repository PSGallery

And add this line to config file to enable Terminal Icons

image

Result of Terminal Icons.

image

Installing Fzf and PSFzf for auto completions of paths or commands in pwsh

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

image

About

Easy-understanding Guide + Config files for setting up pwsh.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published