How can I jump to line in Sublime Text?

Sublimetext2SublimetextSublimetext3

Sublimetext2 Problem Overview


Does anyone know of a shortcut for jumping to a specific line (given a #) in Sublime Text?

Ex: I run code and get an error at line 5765. I want to be able to jump quickly in Sublime Text to line 5765, without scrolling.

Sublimetext2 Solutions


Solution 1 - Sublimetext2

Windows: Ctrl + G

Mac: Control + G

Linux:Ctrl + G

or

Windows: Ctrl + P + :

Mac: Command + P + :

Linux: Ctrl + P + :

Then type the line number. It will automatically find it for you and if it requires scrolling to get to - it will snap your view to the line number level.

Solution 2 - Sublimetext2

Rather than Control+G, if you're used to using CMD+P or CMD+T, you can just type :


Also useful:

  • CMD+R go to function in current file

  • CMD+Shift+R find function in any file (CMD+, "binary_file_patterns" ignore node_modules)

  • CMD+Option+Down jump to function definition in another file (from cursor word)

  • CMD+D / CMD+U jump & accumulate next word occurrence & populate search query / (undo). from cursor becomes an exact match (case and word boundary) vs from selection is a partial match (ignore case and word boundary). D and U also work in less bash / zshell pager to scroll down / up half pages

  • CMD+G / CMD+Shift+G jump or "go" to next / previous search query (CMD+D amazing with this)

  • CMD+{ / CMD+} focuses left / right tab (same in terminals, browser, kapeli dash, etc.)

  • CMD+[ / CMD+] shift line left / right (chrome forward / backward nav, devtools changes panel)

  • CMD+Control+Up / CMD+Control+Down shift line up / down

  • CMD+K->(some number) fold to indentation

  • CMD+K->J unfold all

  • CMD+Option+[ / CMD+Option+] fold / unfold current line's children

  • CMD+, is preferences in most all Mac applications

Solution 3 - Sublimetext2

As pointed out by @maxTuzz, I use Ubuntu 16.06 and Sublime regularly,
this Ctrl+P then Pressing : and Starting typing the Line Number you want to Navigate.

Or

Directly we can type Ctrl+G Starting typing the Line Number you want to Navigate.

Solution 4 - Sublimetext2

In My Mac, Performance>>Key Bindings add:

//line duplicate & delete
{ "keys": ["super+y"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["super+d"], "command": "duplicate_line" },

//replace
{ "keys": ["super+r"], "command": "show_panel", "args": {"panel": "replace", "reverse": false} },

//goto
{ "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
{ "keys": ["super+g"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },

//upper or lower
{ "keys": ["super+shift+u"], "command": "swap_case" },

//sidebar toggle
{ "keys": ["super+shift+t"], "command": "toggle_side_bar" },

Solution 5 - Sublimetext2

base is to press Ctrl + P and a then type : and then write the line that you want to go , BUT there is a shortcut for this :
Just hit Ctrl + G , and it does the same steps for you!

Solution 6 - Sublimetext2

on your keyboard click the:

command + p

then type : on your keyboard follow by the line number, example 374

:374

then click the enter key on your keyboard to jump to the desired line number

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlexsandra GuerraView Question on Stackoverflow
Solution 1 - Sublimetext2maxtuzzView Answer on Stackoverflow
Solution 2 - Sublimetext2neaumusicView Answer on Stackoverflow
Solution 3 - Sublimetext2MD ShahrouqView Answer on Stackoverflow
Solution 4 - Sublimetext2lupguoView Answer on Stackoverflow
Solution 5 - Sublimetext2amdevView Answer on Stackoverflow
Solution 6 - Sublimetext2Gil PerezView Answer on Stackoverflow