Posts tagged "vs-code"

Git stage parts of a file in VS Code

With VS Code, you can interactively select which parts of a file should be staged:

  1. Make changes to a file that is managed with git
  2. Go to the Working Tree view of that file
  3. Select the lines you want to stage and click the right mouse button Diff view
  4. Click Stage Selected Ranges Menu

Additionally, you can also unstage or revert the selected changes.


Disable preview mode in VS Code

Screenshot of file opened in normal and in preview-mode

What is the difference between the left and the right file? The right one is opened in preview mode.

Opening another file won't result in a new tab. Instead, the preview tab is changed to the new file - meaning the file currently previewed is closed.

The preview mode is used e.g. when you click on a file in the explorer or open a file through the Quick Open feature (Ctrl + p).

The following settings will disable the preview mode:

"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen": false

For more information on the preview mode, check out the official documentation.