The most important things to know are `notepad $P...
# social
s
The most important things to know are
notepad $PROFILE
is where you start adding stuff to load when your powershell loads and reloading is done with
. $PROFILE
And then it's a question of finding a posh theme that suits you and start customizing it by doing
Export-PoshTheme
as noted in their docs
n
Ohh this is cool... what does the "Prediction source" stuff do and the Edit Mode stuff?
s
So we're seeing here.. custom icons and colors in the directory listings, predictive autocomplete from historic commands, which is SUPER useful, these are all the things I do very often, no need to type it all out again. Not seen are the keyboard shortcuts, but speak for themselves.. CTRL+F5 to type
dotnet run
+ Enter in the current window, also very useful!
Also bottom pane has the current node version on the right side, the top one the current dotnet version, this is context aware.
m
You can do code $profile so you get powershell syntax highlighting instead of notepad
s
Yeah true! Much nicer indeed
Actually don't know what the edit mode was...maybe that was part Needed for the keyboard ahortcuts
n
Ohh nice, I have a couple of things that might be helpful as well:
Copy code
# PowerShell parameter completion shim for the dotnet CLI
Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock {
    param($commandName, $wordToComplete, $cursorPosition)
        dotnet complete --position $cursorPosition "$wordToComplete" | ForEach-Object {
           [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
        }
}
Up/down last commands, but extended as it persists beyond the current instance of your powershell as it reads from the history
Copy code
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
I also have
Import-Module npm-completion
for autocomplete on npm commands
s
Excellent I'll have a play with those as well!
Ah I see, so
dotnet
and then
CTRL+SPACE
gives hints.. cool!
npm completion is also nice!
w
@User care to share your JSON config of ohmyposh ?
s
Sure thing!
w
Thanks a nice couple of bits you got in here for execution time etc
s
Oh yeah totally stolen from another theme of course!