user956609
user956609

Reputation: 1311

How to jump the line of breakpoint in Visual Studio Code?

for example, i create a breakpoint at line 22,to just create a mark there

Add a breakpoint at line 22

and while im coding, i want to jump to my mark line, for this breakpont is line 22, is there any shortcut to jump to breakpoint line there?

ctrl+G simply jumps to a line but not my breakpoint

Upvotes: 13

Views: 8162

Answers (3)

konieckropka
konieckropka

Reputation: 509

It's possible to enhance workflow with setting up Go to Next Breakpoint as alternative F3 key action, which is by default assigned to Find Next command. Finding next occurrence of searched word is obviously quite important but we can assign F3 to both commands with also declaring When Expression.

  1. CTRL+K CTRL+S (Open Keyboard Shortcuts window)
  2. paste editor.debug.action.goToNextBreakpoint to find Next breakpoint command
  3. set keybinding to f3 key (press F3 and ENTER)
  4. type "f3" In search field to list all commands using that key
  5. select Debug: Go to Next Breakpoint command
  6. CTRL+K CTRL+E (Changing When Expression)
  7. Type: editorFocus && breakpointsExist && !findWidgetVisible
  8. select Find Next command
  9. CTRL+K CTRL+E (Changing When Expression)
  10. Change default When expression to: editorFocus && findWidgetVisible

Next Breakpoint in VS Code F3 Key

Upvotes: 2

Zhi Yuan
Zhi Yuan

Reputation: 890

  1. press ctrl+p and search Keyboard Shortcuts enter image description here

  2. search breakpoint and set Go To Next Breakpoint. I have set the key on F4 enter image description here

Upvotes: 1

monotasker
monotasker

Reputation: 580

You can set the shortcut for this:

{
  "key": "",
  "command": "editor.debug.action.goToNextBreakpoint"
}

To do this, first go to the The Keyboard Shortcuts editor, and search goToNextBreakpoint, and add your preferred shortcut.

Upvotes: 10

Related Questions