How to open 'Go to definition' in other split tab for same file in VS Code?How do I open multiple instances of Visual Studio Code?How to customize the tab-to-space conversion factor?How do you format code in Visual Studio Code (VSCode)How to make VS Code to treat other file extensions as certain language?How to use Visual Studio Code as Default Editor for GitVisual Studio Code: Auto-refresh file changesHow do I hide certain files from the sidebar in Visual Studio Code?Open files always in a new tabVS Code multiple views of same file WITHOUT splittingvscode: Go to definition in other editor pane
Prevent use of CNAME record for untrusted domain
I don't have the theoretical background in my PhD topic. I can't justify getting the degree
Are the players on the same team as the DM?
How much does Commander Data weigh?
How to gently end involvement with an online community?
How many birds in the bush?
How can I download a file through 2 SSH connections?
How were medieval castles built in swamps or marshes without draining them?
Removal of て in Japanese novels
Why is proof-of-work required in Bitcoin?
Nothing like a good ol' game of ModTen
Tipa throwing error because of `implies` and `iff`. Workaround or fix?
Changing JPEG to RAW to use on Lightroom?
Is first Ubuntu user root?
Why is "-ber" the suffix of the last four months of the year?
Very slow boot time and poor perfomance
What do these commands specifically do?
What stops you from using fixed income in developing countries?
When calculating a force, why do I get different result when I try to calculate via torque vs via sum of forces at an axis?
Have you ever been rejected to board the plane because your passport valid less than 3 months?
Do Bayesian credible intervals treat the estimated parameter as a random variable?
Filling a listlineplot with a texture
Evaluated vs. unevaluated Association
"Opusculum hoc, quamdiu vixero, doctioribus emendandum offero."?
How to open 'Go to definition' in other split tab for same file in VS Code?
How do I open multiple instances of Visual Studio Code?How to customize the tab-to-space conversion factor?How do you format code in Visual Studio Code (VSCode)How to make VS Code to treat other file extensions as certain language?How to use Visual Studio Code as Default Editor for GitVisual Studio Code: Auto-refresh file changesHow do I hide certain files from the sidebar in Visual Studio Code?Open files always in a new tabVS Code multiple views of same file WITHOUT splittingvscode: Go to definition in other editor pane
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm considerably new to Visual Studio Code and I am struggling a bit with an easy functionality. Imagine the case when I am reviewing some code in a file a.py and I select 'Go to definition' on a function x of the same file. Is there any possible configuration or shortcut that opens the definition on a split on the editor?
I have tried having already the same file split in the editor an it still opens the definition in the same file what is uncomfortable when you have to trace some code because you need to scroll up and down whenever you want to see another function of the same file.
An extension that allows to do the trick will also be well received. Thanks.
visual-studio-code vscode-settings
add a comment |
I'm considerably new to Visual Studio Code and I am struggling a bit with an easy functionality. Imagine the case when I am reviewing some code in a file a.py and I select 'Go to definition' on a function x of the same file. Is there any possible configuration or shortcut that opens the definition on a split on the editor?
I have tried having already the same file split in the editor an it still opens the definition in the same file what is uncomfortable when you have to trace some code because you need to scroll up and down whenever you want to see another function of the same file.
An extension that allows to do the trick will also be well received. Thanks.
visual-studio-code vscode-settings
Using Visual Studio, I usually just open a new window on the file, move to the line in question in the new window, and then do the Go to definition. That way I have two windows open on the same file viewing different parts of the file.
– Richard Chambers
Jan 10 at 15:15
@RichardChambers Yeah, that is more or less what I do, but it is slow and tedious and I would like some kind of automation on that action so code reviews could be made easily. Thanks for the answer anyway.
– Drubio
Jan 10 at 15:19
As an alternative to the navigation problem, I've found a shortcut that gets you to the place where your cursor was placed previously. At least it eases navigation pain. It isCtrl
+Alt
+-
.
– Drubio
Jun 20 at 7:52
add a comment |
I'm considerably new to Visual Studio Code and I am struggling a bit with an easy functionality. Imagine the case when I am reviewing some code in a file a.py and I select 'Go to definition' on a function x of the same file. Is there any possible configuration or shortcut that opens the definition on a split on the editor?
I have tried having already the same file split in the editor an it still opens the definition in the same file what is uncomfortable when you have to trace some code because you need to scroll up and down whenever you want to see another function of the same file.
An extension that allows to do the trick will also be well received. Thanks.
visual-studio-code vscode-settings
I'm considerably new to Visual Studio Code and I am struggling a bit with an easy functionality. Imagine the case when I am reviewing some code in a file a.py and I select 'Go to definition' on a function x of the same file. Is there any possible configuration or shortcut that opens the definition on a split on the editor?
I have tried having already the same file split in the editor an it still opens the definition in the same file what is uncomfortable when you have to trace some code because you need to scroll up and down whenever you want to see another function of the same file.
An extension that allows to do the trick will also be well received. Thanks.
visual-studio-code vscode-settings
visual-studio-code vscode-settings
edited Mar 27 at 19:34
Drubio
asked Jan 10 at 15:11
DrubioDrubio
5425 silver badges17 bronze badges
5425 silver badges17 bronze badges
Using Visual Studio, I usually just open a new window on the file, move to the line in question in the new window, and then do the Go to definition. That way I have two windows open on the same file viewing different parts of the file.
– Richard Chambers
Jan 10 at 15:15
@RichardChambers Yeah, that is more or less what I do, but it is slow and tedious and I would like some kind of automation on that action so code reviews could be made easily. Thanks for the answer anyway.
– Drubio
Jan 10 at 15:19
As an alternative to the navigation problem, I've found a shortcut that gets you to the place where your cursor was placed previously. At least it eases navigation pain. It isCtrl
+Alt
+-
.
– Drubio
Jun 20 at 7:52
add a comment |
Using Visual Studio, I usually just open a new window on the file, move to the line in question in the new window, and then do the Go to definition. That way I have two windows open on the same file viewing different parts of the file.
– Richard Chambers
Jan 10 at 15:15
@RichardChambers Yeah, that is more or less what I do, but it is slow and tedious and I would like some kind of automation on that action so code reviews could be made easily. Thanks for the answer anyway.
– Drubio
Jan 10 at 15:19
As an alternative to the navigation problem, I've found a shortcut that gets you to the place where your cursor was placed previously. At least it eases navigation pain. It isCtrl
+Alt
+-
.
– Drubio
Jun 20 at 7:52
Using Visual Studio, I usually just open a new window on the file, move to the line in question in the new window, and then do the Go to definition. That way I have two windows open on the same file viewing different parts of the file.
– Richard Chambers
Jan 10 at 15:15
Using Visual Studio, I usually just open a new window on the file, move to the line in question in the new window, and then do the Go to definition. That way I have two windows open on the same file viewing different parts of the file.
– Richard Chambers
Jan 10 at 15:15
@RichardChambers Yeah, that is more or less what I do, but it is slow and tedious and I would like some kind of automation on that action so code reviews could be made easily. Thanks for the answer anyway.
– Drubio
Jan 10 at 15:19
@RichardChambers Yeah, that is more or less what I do, but it is slow and tedious and I would like some kind of automation on that action so code reviews could be made easily. Thanks for the answer anyway.
– Drubio
Jan 10 at 15:19
As an alternative to the navigation problem, I've found a shortcut that gets you to the place where your cursor was placed previously. At least it eases navigation pain. It is
Ctrl
+ Alt
+ -
.– Drubio
Jun 20 at 7:52
As an alternative to the navigation problem, I've found a shortcut that gets you to the place where your cursor was placed previously. At least it eases navigation pain. It is
Ctrl
+ Alt
+ -
.– Drubio
Jun 20 at 7:52
add a comment |
2 Answers
2
active
oldest
votes
There are 2 ways to achieve this.
Either:
- Left-click function name that you want to open.
- Ctrl + t
- Ctrl + enter
Or:
- Change setting
Editor > Goto Location: Multiple
to begotoAndPeek
orgoto
- Ctrl + Alt + [click on function name]
Both methods will open the definition in the split to the right (or create a new split if this is the right-most split).
You like?
The second one withgotoAndPeek
works like a charm and is exactly what I was looking for. Thank you.
– Drubio
Jun 28 at 13:49
What if we want to open the file in a split to the left?
– ForeverWintr
Jun 29 at 23:22
2
@ForeverWintr Sorry I don't think that's possible. I think the idea is for us to always work primarily on the left-most split and drill-down further and further towards the right. I guess we need to adopt this approach.
– Rich
Jul 1 at 14:36
1
@ForeverWintr Actually take a look at the settingsWorkbench > Editor: Open Positioning
andWorkbench > Editor: Open Side By Side Direction
- these let you set the direction of the split!
– Rich
Jul 22 at 12:00
Awesome! Thanks for the follow up!
– ForeverWintr
Jul 22 at 19:27
add a comment |
You have two different ways to do that task:
First one is, with the cursor on the word that you want to go to definition, press Alt+F12
.
It opens a new tab like this one:
Second one is edit the settings and add this line:
"workbench.editor.enablePreview": false
It disables all the previews for code files so always that you want to go to definition, they will be open in a new tab, as you can see here:
1
Thanks for the answer, but these trick does not get the functionality I want. I want the code in two sides on a plit so I can see both at the same time. The first one does not do nothing, when pressing onlyF12
I go to the definition in the classic way, when pressingShift+ALT+F12
it finds all references, but when I pressAlt+F12
it does nothing. taking into account the other option, I already have that setting disabled from settings, so I think it has nothing to do with it.
– Drubio
Jan 10 at 16:52
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54131613%2fhow-to-open-go-to-definition-in-other-split-tab-for-same-file-in-vs-code%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
There are 2 ways to achieve this.
Either:
- Left-click function name that you want to open.
- Ctrl + t
- Ctrl + enter
Or:
- Change setting
Editor > Goto Location: Multiple
to begotoAndPeek
orgoto
- Ctrl + Alt + [click on function name]
Both methods will open the definition in the split to the right (or create a new split if this is the right-most split).
You like?
The second one withgotoAndPeek
works like a charm and is exactly what I was looking for. Thank you.
– Drubio
Jun 28 at 13:49
What if we want to open the file in a split to the left?
– ForeverWintr
Jun 29 at 23:22
2
@ForeverWintr Sorry I don't think that's possible. I think the idea is for us to always work primarily on the left-most split and drill-down further and further towards the right. I guess we need to adopt this approach.
– Rich
Jul 1 at 14:36
1
@ForeverWintr Actually take a look at the settingsWorkbench > Editor: Open Positioning
andWorkbench > Editor: Open Side By Side Direction
- these let you set the direction of the split!
– Rich
Jul 22 at 12:00
Awesome! Thanks for the follow up!
– ForeverWintr
Jul 22 at 19:27
add a comment |
There are 2 ways to achieve this.
Either:
- Left-click function name that you want to open.
- Ctrl + t
- Ctrl + enter
Or:
- Change setting
Editor > Goto Location: Multiple
to begotoAndPeek
orgoto
- Ctrl + Alt + [click on function name]
Both methods will open the definition in the split to the right (or create a new split if this is the right-most split).
You like?
The second one withgotoAndPeek
works like a charm and is exactly what I was looking for. Thank you.
– Drubio
Jun 28 at 13:49
What if we want to open the file in a split to the left?
– ForeverWintr
Jun 29 at 23:22
2
@ForeverWintr Sorry I don't think that's possible. I think the idea is for us to always work primarily on the left-most split and drill-down further and further towards the right. I guess we need to adopt this approach.
– Rich
Jul 1 at 14:36
1
@ForeverWintr Actually take a look at the settingsWorkbench > Editor: Open Positioning
andWorkbench > Editor: Open Side By Side Direction
- these let you set the direction of the split!
– Rich
Jul 22 at 12:00
Awesome! Thanks for the follow up!
– ForeverWintr
Jul 22 at 19:27
add a comment |
There are 2 ways to achieve this.
Either:
- Left-click function name that you want to open.
- Ctrl + t
- Ctrl + enter
Or:
- Change setting
Editor > Goto Location: Multiple
to begotoAndPeek
orgoto
- Ctrl + Alt + [click on function name]
Both methods will open the definition in the split to the right (or create a new split if this is the right-most split).
You like?
There are 2 ways to achieve this.
Either:
- Left-click function name that you want to open.
- Ctrl + t
- Ctrl + enter
Or:
- Change setting
Editor > Goto Location: Multiple
to begotoAndPeek
orgoto
- Ctrl + Alt + [click on function name]
Both methods will open the definition in the split to the right (or create a new split if this is the right-most split).
You like?
edited Jun 28 at 13:31
answered Jun 28 at 13:19
RichRich
1531 gold badge1 silver badge10 bronze badges
1531 gold badge1 silver badge10 bronze badges
The second one withgotoAndPeek
works like a charm and is exactly what I was looking for. Thank you.
– Drubio
Jun 28 at 13:49
What if we want to open the file in a split to the left?
– ForeverWintr
Jun 29 at 23:22
2
@ForeverWintr Sorry I don't think that's possible. I think the idea is for us to always work primarily on the left-most split and drill-down further and further towards the right. I guess we need to adopt this approach.
– Rich
Jul 1 at 14:36
1
@ForeverWintr Actually take a look at the settingsWorkbench > Editor: Open Positioning
andWorkbench > Editor: Open Side By Side Direction
- these let you set the direction of the split!
– Rich
Jul 22 at 12:00
Awesome! Thanks for the follow up!
– ForeverWintr
Jul 22 at 19:27
add a comment |
The second one withgotoAndPeek
works like a charm and is exactly what I was looking for. Thank you.
– Drubio
Jun 28 at 13:49
What if we want to open the file in a split to the left?
– ForeverWintr
Jun 29 at 23:22
2
@ForeverWintr Sorry I don't think that's possible. I think the idea is for us to always work primarily on the left-most split and drill-down further and further towards the right. I guess we need to adopt this approach.
– Rich
Jul 1 at 14:36
1
@ForeverWintr Actually take a look at the settingsWorkbench > Editor: Open Positioning
andWorkbench > Editor: Open Side By Side Direction
- these let you set the direction of the split!
– Rich
Jul 22 at 12:00
Awesome! Thanks for the follow up!
– ForeverWintr
Jul 22 at 19:27
The second one with
gotoAndPeek
works like a charm and is exactly what I was looking for. Thank you.– Drubio
Jun 28 at 13:49
The second one with
gotoAndPeek
works like a charm and is exactly what I was looking for. Thank you.– Drubio
Jun 28 at 13:49
What if we want to open the file in a split to the left?
– ForeverWintr
Jun 29 at 23:22
What if we want to open the file in a split to the left?
– ForeverWintr
Jun 29 at 23:22
2
2
@ForeverWintr Sorry I don't think that's possible. I think the idea is for us to always work primarily on the left-most split and drill-down further and further towards the right. I guess we need to adopt this approach.
– Rich
Jul 1 at 14:36
@ForeverWintr Sorry I don't think that's possible. I think the idea is for us to always work primarily on the left-most split and drill-down further and further towards the right. I guess we need to adopt this approach.
– Rich
Jul 1 at 14:36
1
1
@ForeverWintr Actually take a look at the settings
Workbench > Editor: Open Positioning
and Workbench > Editor: Open Side By Side Direction
- these let you set the direction of the split!– Rich
Jul 22 at 12:00
@ForeverWintr Actually take a look at the settings
Workbench > Editor: Open Positioning
and Workbench > Editor: Open Side By Side Direction
- these let you set the direction of the split!– Rich
Jul 22 at 12:00
Awesome! Thanks for the follow up!
– ForeverWintr
Jul 22 at 19:27
Awesome! Thanks for the follow up!
– ForeverWintr
Jul 22 at 19:27
add a comment |
You have two different ways to do that task:
First one is, with the cursor on the word that you want to go to definition, press Alt+F12
.
It opens a new tab like this one:
Second one is edit the settings and add this line:
"workbench.editor.enablePreview": false
It disables all the previews for code files so always that you want to go to definition, they will be open in a new tab, as you can see here:
1
Thanks for the answer, but these trick does not get the functionality I want. I want the code in two sides on a plit so I can see both at the same time. The first one does not do nothing, when pressing onlyF12
I go to the definition in the classic way, when pressingShift+ALT+F12
it finds all references, but when I pressAlt+F12
it does nothing. taking into account the other option, I already have that setting disabled from settings, so I think it has nothing to do with it.
– Drubio
Jan 10 at 16:52
add a comment |
You have two different ways to do that task:
First one is, with the cursor on the word that you want to go to definition, press Alt+F12
.
It opens a new tab like this one:
Second one is edit the settings and add this line:
"workbench.editor.enablePreview": false
It disables all the previews for code files so always that you want to go to definition, they will be open in a new tab, as you can see here:
1
Thanks for the answer, but these trick does not get the functionality I want. I want the code in two sides on a plit so I can see both at the same time. The first one does not do nothing, when pressing onlyF12
I go to the definition in the classic way, when pressingShift+ALT+F12
it finds all references, but when I pressAlt+F12
it does nothing. taking into account the other option, I already have that setting disabled from settings, so I think it has nothing to do with it.
– Drubio
Jan 10 at 16:52
add a comment |
You have two different ways to do that task:
First one is, with the cursor on the word that you want to go to definition, press Alt+F12
.
It opens a new tab like this one:
Second one is edit the settings and add this line:
"workbench.editor.enablePreview": false
It disables all the previews for code files so always that you want to go to definition, they will be open in a new tab, as you can see here:
You have two different ways to do that task:
First one is, with the cursor on the word that you want to go to definition, press Alt+F12
.
It opens a new tab like this one:
Second one is edit the settings and add this line:
"workbench.editor.enablePreview": false
It disables all the previews for code files so always that you want to go to definition, they will be open in a new tab, as you can see here:
answered Jan 10 at 16:36
InazenseInazense
3766 silver badges11 bronze badges
3766 silver badges11 bronze badges
1
Thanks for the answer, but these trick does not get the functionality I want. I want the code in two sides on a plit so I can see both at the same time. The first one does not do nothing, when pressing onlyF12
I go to the definition in the classic way, when pressingShift+ALT+F12
it finds all references, but when I pressAlt+F12
it does nothing. taking into account the other option, I already have that setting disabled from settings, so I think it has nothing to do with it.
– Drubio
Jan 10 at 16:52
add a comment |
1
Thanks for the answer, but these trick does not get the functionality I want. I want the code in two sides on a plit so I can see both at the same time. The first one does not do nothing, when pressing onlyF12
I go to the definition in the classic way, when pressingShift+ALT+F12
it finds all references, but when I pressAlt+F12
it does nothing. taking into account the other option, I already have that setting disabled from settings, so I think it has nothing to do with it.
– Drubio
Jan 10 at 16:52
1
1
Thanks for the answer, but these trick does not get the functionality I want. I want the code in two sides on a plit so I can see both at the same time. The first one does not do nothing, when pressing only
F12
I go to the definition in the classic way, when pressing Shift+ALT+F12
it finds all references, but when I press Alt+F12
it does nothing. taking into account the other option, I already have that setting disabled from settings, so I think it has nothing to do with it.– Drubio
Jan 10 at 16:52
Thanks for the answer, but these trick does not get the functionality I want. I want the code in two sides on a plit so I can see both at the same time. The first one does not do nothing, when pressing only
F12
I go to the definition in the classic way, when pressing Shift+ALT+F12
it finds all references, but when I press Alt+F12
it does nothing. taking into account the other option, I already have that setting disabled from settings, so I think it has nothing to do with it.– Drubio
Jan 10 at 16:52
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54131613%2fhow-to-open-go-to-definition-in-other-split-tab-for-same-file-in-vs-code%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Using Visual Studio, I usually just open a new window on the file, move to the line in question in the new window, and then do the Go to definition. That way I have two windows open on the same file viewing different parts of the file.
– Richard Chambers
Jan 10 at 15:15
@RichardChambers Yeah, that is more or less what I do, but it is slow and tedious and I would like some kind of automation on that action so code reviews could be made easily. Thanks for the answer anyway.
– Drubio
Jan 10 at 15:19
As an alternative to the navigation problem, I've found a shortcut that gets you to the place where your cursor was placed previously. At least it eases navigation pain. It is
Ctrl
+Alt
+-
.– Drubio
Jun 20 at 7:52