Jump To A Specific Line Sublime Text For Mac

It was looking like the Sublime Text team weren’t planning to fix the issue, hence my interest in solving the problem – but according to a recent post on this thread, the issue is solved in the new beta of Sublime Text 3. I’m posting the proxy anyways for people still using Sublime Text 2.

Active3 months ago

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.

Thanks!

Alexsandra GuerraAlexsandra Guerra
7402 gold badges9 silver badges17 bronze badges

6 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.

Hope that helps.

Happy coding!

maxtuzzmaxtuzz
1,7461 gold badge6 silver badges7 bronze badges

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

neaumusicneaumusic
5,6132 gold badges31 silver badges51 bronze badges

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.

MD ShahrouqMD Shahrouq

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!

Jump To A Specific Line Sublime Text For Mac

a_m_deva_m_dev
1,5403 gold badges16 silver badges35 bronze badges

on your keyboard click the:

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

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

Gil PerezGil Perez
Rod TerryRod Terry

Jump To A Specific Line Sublime Text For Mac Download

Not the answer you're looking for? Browse other questions tagged sublimetext2sublimetextsublimetext3 or ask your own question.

Active3 years, 2 months ago

I have read the key bindings file of Sublime Text 2

I'm wondering if we can move to the end of line without END key in keyboard.

In vim, I just ESC and A, then the cursor would be in the end of line.

lit2019
lit2019lit2019
9002 gold badges12 silver badges25 bronze badges

8 Answers

To change the key binding, open Key Bindings - User preferences and add a new line between the square brackets. For example, to set the key binding to Control-Alt-Command-A you'd use:

If this line that you're adding is not the last line before the closing square bracket, then you'll need to include a comma at the end of the line. For example:

Jump to a specific line sublime text for mac download

You should check the Key Bindings - Default preferences to make sure that the key binding you're setting here doesn't conflict with anything else that you might use.

Jump to a specific line sublime text for mac download

You shouldn't edit the Key Bindings - Default preferences directly, because they will be overwritten in Sublime Text 2 upgrades.

James ChevalierJames Chevalier
8,2441 gold badge38 silver badges63 bronze badges

Command+RightArrowKey on Mac.Control+RightArrowKey on Windows

YilingYiling
1,9732 gold badges17 silver badges22 bronze badges

1) Hit Super+Shift+P to open Command Palette (Ctrl+Shift+P on Windows)

2) Type 'kbu' to open Preferences: Key Bindings - User

3) Copy / paste the following code into it:

(Note: if the file is not empty then obviously you know what to do.)

4) Hit Super+S (Ctrl+S) to save and you are all set!

I chose Super+; shortcut for I often write in PHP and it's convenient to end lines with a semicolon. Other options could be Ctrl+; or Super+. or whatever else you find convenient.

GeoGeo
9,6344 gold badges27 silver badges52 bronze badges

If you're a fan of vim you can enable Vintage mode in Sublime Text 2

Preferences: Settings - User

Then remove Vintage from the ignored_packages.

tayopitayopi

How about binding something that'll make you faster? This is what I use (from Key bindings - user):

This way, to go to end of the line I use alt+;, and to go to eof I use alt+shift+;

Or use Vim...

Flow OverstackFlow Overstack
BindiryBindiry

You can just replace the key with something other than 'end'. Don't edit the main key bindings file though. Add the change to th user version and it will override the defaults.

ValjasValjas
4,6261 gold badge16 silver badges31 bronze badges

I use [ESC] and [A] in Sublime too :-) - I know it's a long time after you asked the question, but I've started using VIM recently, and configured Sublime to use vintage mode. As I'm fairly new to Sublime too, I'm not 100% sure, but I think you should edit the user preferences file rather than the default preferences file as suggested in the above link, as I gather the default file can get overwritten, and the user preference will override the default anyway. Hope this helps.

Ronan MoriartyRonan Moriarty

Not the answer you're looking for? Browse other questions tagged sublimetext2 or ask your own question.