|
| 1 | +# ISE Compatibility |
| 2 | + |
| 3 | +While the PowerShell extension for VSCode does not seek |
| 4 | +complete feature parity with the PowerShell ISE, |
| 5 | +there are features in place to make the VSCode experience more natural |
| 6 | +for users of the ISE. |
| 7 | + |
| 8 | +This document tries to list settings you can configure in VSCode |
| 9 | +to make the user experience a bit more familiar compared to the ISE. |
| 10 | + |
| 11 | +## Key bindings |
| 12 | + |
| 13 | +| Function | ISE Binding | VSCode Binding | |
| 14 | +| ---------------- | ----------- | -------------- | |
| 15 | +| Interrupt and break debugger | <kbd>Ctrl</kbd>+<kbd>B</kbd> | <kbd>F6</kbd> | |
| 16 | +| Execute current line/highlighted text | <kbd>F8</kbd> | <kbd>F8</kbd> | |
| 17 | +| List available snippets | <kbd>Ctrl</kbd>+<kbd>J</kbd> | <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>J</kbd> | |
| 18 | + |
| 19 | +### Custom Keybindings |
| 20 | + |
| 21 | +You can [configure your own keybindings](https://code.visualstudio.com/docs/getstarted/keybindings#_custom-keybindings-for-refactorings) |
| 22 | +in VSCode as well. |
| 23 | + |
| 24 | +## Tab completion |
| 25 | + |
| 26 | +To enable more ISE-like tab completion, add this setting: |
| 27 | + |
| 28 | +```json |
| 29 | +"editor.tabCompletion": "on" |
| 30 | +``` |
| 31 | + |
| 32 | +This is a setting added directly to VSCode (rather than in the extension), |
| 33 | +so its behavior is determined by VSCode directly and cannot be changed by the extension. |
| 34 | + |
| 35 | +## No focus on console when executing |
| 36 | + |
| 37 | +To keep the focus in the editor when you execute with <kbd>F8</kbd>: |
| 38 | + |
| 39 | +```json |
| 40 | +"powershell.integratedConsole.focusConsoleOnExecute": false |
| 41 | +``` |
| 42 | + |
| 43 | +The default is `true` for accessibility purposes. |
| 44 | + |
| 45 | +## Do not start integrated console on startup |
| 46 | + |
| 47 | +To stop the integrated console on startup, set: |
| 48 | + |
| 49 | +```json |
| 50 | +"powershell.integratedConsole.showOnStartup": false |
| 51 | +``` |
| 52 | + |
| 53 | +**Note:** The background PowerShell process will still start, |
| 54 | +since that provides intellisense, script analysis, symbol navigation, etc. |
| 55 | +But the console will not be shown. |
| 56 | + |
| 57 | +## Assume files are PowerShell by default |
| 58 | + |
| 59 | +To make new/untitled files register as PowerShell by default: |
| 60 | + |
| 61 | +```json |
| 62 | +"files.defaultLanguage": "powershell" |
| 63 | +``` |
| 64 | + |
| 65 | +## Color scheme |
| 66 | + |
| 67 | +There are a number of ISE themes available for VSCode |
| 68 | +to make the editor look much more like the ISE. |
| 69 | + |
| 70 | +In the [Command Palette] |
| 71 | +type `theme` to get `Preferences: Color Theme` and press <kbd>Enter</kbd>. |
| 72 | +In the drop down list, select `PowerShell ISE`. |
| 73 | + |
| 74 | +You can set this in the settings with: |
| 75 | + |
| 76 | +```json |
| 77 | +"workbench.colorTheme": "PowerShell ISE" |
| 78 | +``` |
| 79 | + |
| 80 | +## PowerShell Command Explorer |
| 81 | + |
| 82 | +Thanks to the work of [@corbob](https://github.com/corbob), |
| 83 | +the PowerShell extension has the beginnings of its own command explorer. |
| 84 | + |
| 85 | +In the [Command Palette] |
| 86 | +enter `PowerShell Command Explorer` and press <kbd>Enter</kbd>. |
| 87 | + |
| 88 | +## Open in the ISE |
| 89 | + |
| 90 | +If you end up wanting to open a file in the ISE anyway, |
| 91 | +you can use <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>P</kbd>. |
| 92 | + |
| 93 | +## Other resources |
| 94 | + |
| 95 | +- 4sysops has [a great article](https://4sysops.com/archives/make-visual-studio-code-look-and-behave-like-powershell-ise/) |
| 96 | + on configuring VSCode to be more like the ISE. |
| 97 | +- Mike F Robbins has [a really good post](https://mikefrobbins.com/2017/08/24/how-to-install-visual-studio-code-and-configure-it-as-a-replacement-for-the-powershell-ise/) on setting up VSCode. |
| 98 | +- Learn PowerShell has [an excellent write up](https://www.learnpwsh.com/setup-vs-code-for-powershell/) |
| 99 | + on getting VSCode setup for PowerShell. |
| 100 | + |
| 101 | +## More settings |
| 102 | + |
| 103 | +If you know of more ways to make VSCode feel more familiar |
| 104 | +for ISE users, please contribute to this doc. |
| 105 | +If there's a compatibility configuration you're looking for, |
| 106 | +but you can't find any way to enable it, |
| 107 | +please [open an issue](https://github.com/PowerShell/vscode-powershell/issues/new/choose) |
| 108 | +and ask away! |
| 109 | + |
| 110 | +We are always happy to accept PRs and contributions as well! |
| 111 | + |
| 112 | +## VSCode Tips |
| 113 | + |
| 114 | +### Command Palette |
| 115 | + |
| 116 | +<kbd>F1</kbd> OR <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> |
| 117 | +(<kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> on macOS) |
| 118 | + |
| 119 | +A handy way of executing commands in VSCode. |
| 120 | +See [the VSCode docs](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) |
| 121 | +for more details. |
| 122 | + |
| 123 | +[Command Palette]: #command-palette |
0 commit comments