Muscle memory is a heck of a thing. When I want to build code I type Ctrl-Shift-B. I can’t not. It’s built into my hands! Ctrl-Shift-T is test (even though it’s non-standard, it’s there, in my hands. I spend a lot of time at the command line, in Windows Terminal, in PowerShell, using PSReadLine. So why not make a few of these intuitive hotkeys work for me there as well? PSReadLine supports Set-PSReadLineKeyHandler which is basically hotkey bindings to any arbitrary script block. Here’s Shift-Ctrl-B typing dotnet build and pressing enter. Just add these to your $profile, after you’ve imported PSReadLine via if ($host.Name -eq 'ConsoleHost') Building with Shift-Ctrl-B Set-PSReadLineKeyHandler -Key Ctrl+Shift+b ` Here’s Shift-Ctrl-T typing dotnet test and pressing enter. Set-PSReadLineKeyHandler -Key Ctrl+Shift+t ` Here’s it in Animated Gif Form! (Using Carnac to see the hotkeys being pressed) ![]() Since I am using Ctrl+Shift+T for testing (that’s just me) I did need to manually unbind it from New Tab in my Windows Terminal settings. Just be aware. { Sweet. What hotkeys will YOU hook up? Sponsor: Have what it takes to code securely? Select from dozens of complimentary interactive challenges in Veracode Security Labs, test your skills, and earn a badge. Learn more. © 2021 Scott Hanselman. All rights reserved. Visual Studio hotkeys at the PowerShell command line in Windows Terminal published first on http://7elementswd.tumblr.com/ via Tumblr Visual Studio hotkeys at the PowerShell command line in Windows Terminal
0 Comments
Leave a Reply. |
About UsIf you want to keep up with the latest in web design, you have to be willing to study and learn on an ongoing basis. If you are a web developer or web designer, you’ll find a lot of useful tutorials and code snippets collection here. Furthermore, we also discuss more general topics of web design and how the role of a web designer has evolved over the years.
|