Sublime Text 3: How to jump to the parent/enclosing function?

8

0

Is there a quick keyboard shortcut or Command Palette function to quickly jump to the parent/enclosing function?

So if the cursor is in a function, then I want to quickly jump to the first line of that function.

I looked around but was unable to find such a shortcut.

Gary

Posted 2014-07-28T03:04:40.607

Reputation: 1 190

Answers

6

Jump to matching brackets is easy!

Stand on some braces(brackets, parentheses) and press: Ctrl+M(Mac ^+M).

File members

enter image description here

Press Ctrl+R(Mac +R) to see list of file members(variables, functions, methods, etc...)

Anton Dozortsev

Posted 2014-07-28T03:04:40.607

Reputation: 2 744

Ctrl+R(Mac +R) was very helpful for me - I came across this post trying to find a way to see the current "scope" of where my cursor was (ie the containing function). This allowed me to do that and then press Esc to get back to the cursor position. – user1063287 – 2019-06-13T02:58:49.447

1

On Windows, press CONTROL + R which lists all the functions in the file with the current function selected. Now, Press ENTER

ProgramCpp

Posted 2014-07-28T03:04:40.607

Reputation: 111

0

Sublime Move By Symbols allows you to navigate between symbols, so if your cursor is inside a function, then ctrl+up will move it to the function name.

Jeremy Halliwell

Posted 2014-07-28T03:04:40.607

Reputation: 191