Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I jump to line in Sublime Text?

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.

like image 361
Alexsandra Guerra Avatar asked Feb 04 '15 21:02

Alexsandra Guerra


People also ask

How do I move a line up and down in Sublime Text?

CTRL-SHIFT-UP (PC) or CTRL-⌘-UP (Mac) moves a line up, while CTRL-SHIFT-DOWN (PC) or CTRL-⌘-DOWN (Mac) moves a line down.

What does Ctrl d do in Sublime Text?

Ctrl + D in SublimeText is "Quick Add Next." This appears to be equivalent to Ctrl + B in Brackets, which is "Add next match to Selection" on the Find menu.

How do I switch between columns in Sublime Text?

You can also use Ctrl + K , Ctrl + -> and Ctrl + K , Ctrl + <- . Glad to help.


2 Answers

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.

like image 89
maxtuzz Avatar answered Sep 22 '22 14:09

maxtuzz


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

like image 20
neaumusic Avatar answered Sep 20 '22 14:09

neaumusic