Automatically format code in Visual Studio Code

You can choose one of the below options “editor.formatOnType”: false, “editor.formatOnPaste”: false, “editor.formatOnSave”: false Or create a custom keyboard shortcut by editing editor.action.formatDocument. But I AFAIK there is no option to execute the command whenever you press ;. You can set a keyboard shortcut, but I guess you’re not able to write ; anymore then … Read more

Visual Studio Code – How to jump by word with [Alt]+[Left/Right]

You are looking for cursorWordPartRight which is bound to Shift–Alt–Q. Alt–Right is bound to a “Go Forward” command, you could delete that binding and use it for the cursorWordPartRight command. { “key”: “alt+right”, “command”: “cursorWordPartRight”, “when”: “editorTextFocus”, }, { “key”: “alt+left”, “command”: “cursorWordPartLeft”, “when”: “editorTextFocus”, } It may require that each language parser support it … Read more

How to split selection into lines?

The command is ‘Add Cursors to Line Ends’ (found in the command palette or the Selection menu). The default keyboard shortcut is Shift+Alt+I. If you’re familiar with Sublime Text, you may prefer Ctrl+Shift+L as a shortcut. In File / Preferences / Keyboard Shortcuts (Json): { “key”: “ctrl+shift+l”, “command”: “editor.action.insertCursorAtEndOfEachLineSelected”, “when”: “editorTextFocus” }, This overrides a … Read more

The new way to configure default shell and argument commands in VSCode?

In the settings.json file we need to have the following “terminal.integrated.profiles.windows”: { “PowerShell”: { “source”: “PowerShell”, “icon”: “terminal-powershell” }, “Command Prompt”: { “path”: [ “${env:windir}\\Sysnative\\cmd.exe”, “${env:windir}\\System32\\cmd.exe” ], “args”: [], “icon”: “terminal-cmd” }, “Git Bash”: { “source”: “Git Bash” } }, And set the default terminal by adding “terminal.integrated.defaultProfile.windows”: “Command Prompt”, We can achieve this by … Read more

Show hidden NodeModules folder in VSCode

Explorer View If node_modules is hidden in your explorer view, then you probably have a pattern that’s matching that directory in your settings. Go to settings, search for files.exclude and ensure that you haven’t excluded the directory in user settings and/or workspace settings. Search Results If you want search results to include node_modules by default, … Read more