VSCode's PowerShell Terminal now offers a kind of suggestion in gray of what you might be wanting to type (presumably from the history?):
But there seems to be no way to actually accept the suggestion: pressing tab just does the normal PowerShell autocomplete (usually of a cmdlet or path).
What is this feature and can I "tab" to get the command tantilisingly shown?
For me it was Shift + RightArrow.
If you have EditMode VI enabled, then make sure to define whatever key combination you would like to use for this to SelectForwardChar. To set SelectForwardChar to Shift + RightArrow insert the following line of code into your VSCode PowerShell Profile:
Set-PSReadLineKeyHandler -Key Shift+RightArrow -Function SelectForwardChar
The key combination SHIFT + RIGHTARROW should do the trick. I hope this helps!
Related
I've achieved Intellisense from the Powershell via PSReadLine, but unlike fish shell where a word from the path can be concluded by hitting Ctrl + Right Arrow, I can't find any such shortcut or solution for this issue in Powershell. If any solutions, I please welcome them.
Example :
I now want to obtain cd '.\PICS\KIRAN\' only.
In fish shell, it's the scenario where you click Ctrl + Right Arrow for 2 times and then you get the expected result.
What should I do to obtain the same result in Windows Powershell ?
Alt+F (forward)
Alt+B (backword)
I'm using VSCode.
When trying to use autocomplete, I get that kind of collapsed box which is not very useful. It forces me to use my mouse.
How to get that "Auto import from ..." always expanded ?
You are looking for the following command id:
toggleSuggestionDetails
Defaults to CTRL + SPACE [windows], while the suggestion list is active: suggestWidgetVisible && textInputFocus
For brevity, the command is a toggle, so you only need to enable it once and the toggle state persists.
Alternatively, if you just want parameter hints you can search for the following command id:
editor.action.triggerParameterHints
Which defaults to CTRL + shift + space [windows]
I had a look to the keyboard shortcuts and I realized you can expand the details by pressing CTRL + space another time.
VSCode's PowerShell Terminal now offers a kind of suggestion in gray of what you might be wanting to type (presumably from the history?):
But there seems to be no way to actually accept the suggestion: pressing tab just does the normal PowerShell autocomplete (usually of a cmdlet or path).
What is this feature and can I "tab" to get the command tantilisingly shown?
For me it was Shift + RightArrow.
If you have EditMode VI enabled, then make sure to define whatever key combination you would like to use for this to SelectForwardChar. To set SelectForwardChar to Shift + RightArrow insert the following line of code into your VSCode PowerShell Profile:
Set-PSReadLineKeyHandler -Key Shift+RightArrow -Function SelectForwardChar
The key combination SHIFT + RIGHTARROW should do the trick. I hope this helps!
What is the best way to select a block of code in VSCode?
Is there any shortCut, which we can use?
You've probably got this by now, but what you need to do is search the Keyboard Shortcuts for the shift+alt+arrow mappings, and swap the cursorColumnSelect commands (currently mapped to ctrl+shift+alt+arrow) with the commands that are currently mapped to the desired keys.
Depends on the language, it was already asked btw.
Check this, works with HTML and JS
Also pressing Ctrl + I + up/down arrow will select the whole next line.
You can press SHIFT and select code with arrow keys.
I know I can use F7 to display command history and I can search the history to find a command that I've typed before ( like for example :)
Get-History |select -expand commandline |sls proc
but I wonder if the is a way to use a keybord shortcut to cycle through the history (like ctrl+R does on linux console) ?
Tab completion supports searching through memory, you could type:
#proc<TAB>
to cycle through commands that match the string 'proc'. But if you're looking for a more bash like editing experience, then you want PSReadline - https://github.com/lzybkr/PSReadLine.