[Solved] How to disable preview when go to definition in vscode?

If you are a Visual Studio Code (VSCode) user, you may have experienced the annoyance of accidentally previewing the definition of a code element by hovering over it with your mouse or pressing the "Go to Definition" keyboard shortcut. This can be especially frustrating when you have multiple open files and the preview takes over your entire screen, disrupting your workflow.

Fortunately, there is a simple solution to disable the preview feature in VSCode. Follow these steps to turn off the preview when you go to definition in VSCode:

Step 1: Open the VSCode settings by pressing "Ctrl + ," (Windows) or "Cmd + ," (Mac).

Step 2: In the search bar, type "editor.gotoLocation.multipleDefinitions" and press Enter.

Step 3: Uncheck the box next to "Show peek view for Go to Definition" to disable the preview feature.

Step 4: Save the settings by clicking the "Save" button in the top right corner of the settings window.

That's it! You have successfully disabled the preview feature when you go to definition in VSCode.

It's important to note that this setting applies to all definitions, not just those accessed by hovering or the "Go to Definition" shortcut. If you still want to see a preview for some definitions, you can use the "Peek Definition" feature, which allows you to view the definition in a small window without navigating away from your current file.

In summary, disabling the preview when you go to definition in VSCode is a simple process that can help you avoid distractions and stay focused on your work. With this feature turned off, you can work more efficiently and get more done in less time.