13

Visual Studio Code has a "Go to symbol" command, which can go to either a variable name or a function. However what I usually want is to jump to a function name, so I'm wondering is there any command or shortcut to do this?

laurent
  • 6,089

3 Answers3

22

For jumping to function in currently opened file use Ctrl+Shift+O.

From docs:

You can navigate symbols inside a file with Ctrl+Shift+O. By typing : the symbols will be grouped by category. Press Up or Down and navigate to the place you want.

https://code.visualstudio.com/docs/editor/editingevolved#_go-to-symbol

mimo
  • 386
8

In VSCode Ctrl+T shortcut put the focus on the dialog where you can type the name of the symbol you want to navigate to.

From VSDocs:

Key                          Command              Command id
⌘T (Windows, Linux Ctrl+T)  Show All Symbols     workbench.action.showAllSymbols

It relays on the support installed maybe via plugins. In order to navigate to symbols on a language, the support for that language must be installed. It works fine for me on Angular projects with Typescript symbols.

nilsandrey
  • 281
  • 1
  • 4
5

You can use : to classify symbols by type

Eg: @:your-function

Refered from https://stackoverflow.com/questions/60278165/vs-code-go-to-symbol-nowv1-42-showing-variables-object-and-properties-how-to
Added as answer as I can't comment

hiru007
  • 51
  • 1
    Welcome to Super User! Before answering an old question having other answers ensure your answer adds something new or is otherwise helpful in relation to them. Here is a guide on [answer]. There is also a site [tour] and a [help]. Please note the reference link quoted by @mimo is better than yours. – help-info.de May 08 '23 at 07:13
  • 1
    This answer was actually what I needed, but also I feel it answers the primary question properly, great find! – melfy Oct 09 '23 at 20:31