Shortcut for opening the definition file in a split vertical group in vscode

六月ゝ 毕业季﹏ 提交于 2021-01-28 09:53:34

问题


Are there any shortcuts to open the definition (e.g.: a method definition) in a split vertical group? By ctrl + click on the usage of method, it opens in a new tab. It bothers me, because I have to leave my own tab.

(I know that after opening in a new tab, by pressing ctrl + \ it will be open it in a new group, but this also has the same problem: I lose my own tab, and a second problem: when I want to close the definition file, I have to close it from both the 2nd group and the 1st group.)

Are there any shortcuts to open the definition file directly in a new group?


回答1:


Ctrl+Alt+Click seems to open the definiton file in a split editor.

It'll open to whatever you have this setting:

Workbench > Editor: Open Side By Side Direction // options are right and down


Note that it'll directly open the definiton file in a split editor only if there is a single possible defintion file. For example, you may have both a source and a dist folder with the same files in them (after some task runner commands perhaps). If there is more than one option, vscode will instead open a peek window with the multiple references listed to the right side. You can Ctrl+Click on whichever of those you want to open to the side.



来源:https://stackoverflow.com/questions/63213774/shortcut-for-opening-the-definition-file-in-a-split-vertical-group-in-vscode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!