Skip to content

Instantly share code, notes, and snippets.

@akhansari
Last active October 30, 2023 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akhansari/f7b347186d219ee0a5fee861095aa51a to your computer and use it in GitHub Desktop.
Save akhansari/f7b347186d219ee0a5fee861095aa51a to your computer and use it in GitHub Desktop.
My PowerShell Setup on Windows (Which is more or less the same on Linux)
# open PowerShell legacy
# install https://scoop.sh
irm get.scoop.sh | iex
# add extras bucket
scoop bucket add extras
# install the new PowerShell
scoop install pwsh
# install https://starship.rs
scoop install starship
# install https://github.com/ajeetdsouza/zoxide
scoop install zoxide
# install https://wezfurlong.org/wezterm
scoop install wezterm
# update wezterm config
code ~/.wezterm.lua
# copy/past/save the content provided in this gist
# switch now to wezterm
# update PowerShell config
code $PROFILE
# copy/past/save the content of Microsoft.PowerShell_profile.ps1 provided in this gist
# restart wezterm
# enjoy
local wezterm = require 'wezterm'
local config = {}
config.default_prog = { 'pwsh' }
config.hide_tab_bar_if_only_one_tab = true
config.font_size = 10.0
config.keys = {
{ key = 'l', mods = 'ALT', action = wezterm.action.ShowLauncher },
{
key = 'h',
mods = 'ALT',
action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' },
},
{
key = 'v',
mods = 'ALT',
action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' },
},
}
return config
Invoke-Expression (&starship init powershell)
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
Set-PSReadLineOption -PredictionViewStyle ListView
Invoke-Expression (& zoxide init --hook 'pwd' powershell | Out-String)
# https://7-zip.org
scoop install 7zip
# https://github.com/sharkdp/bat > A cat(1) clone with wings
scoop install bat
# https://github.com/sharkdp/fd > A simple, fast and user-friendly alternative to 'find'
scoop install fd
# https://github.com/junegunn/fzf > A command-line fuzzy finder
scoop install fzf
# https://micro-editor.github.io > A modern and intuitive terminal-based text editor
scoop install micro
# https://github.com/BurntSushi/ripgrep > Recursively searches directories for a regex pattern while respecting your gitignore
scoop install ripgrep
# https://github.com/XAMPPRocky/tokei > Count your code, quickly
scoop install tokei
# https://github.com/ajeetdsouza/zoxide > A smarter cd command
scoop install zoxide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment